📄 readtextprices.java
字号:
import java.io.*;
public class ReadTextPrices
{
public static void main(String[] args)
throws java.io.IOException
{
String fileName = "prices.txt";
int i;
String inLine;
// set up the basic input stream
FileReader fr = new
FileReader(fileName);
// buffer the input stream
BufferedReader br =
new BufferedReader(fr);
// read and display three lines
for(i = 0; i < 3; i++)
{
inLine = br.readLine(); // read a line
System.out.println(inLine); // display the line
}
br.close();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -