?? readtextprices2.java
字號:
import java.io.*;
import java.util.*; // needed for StringTokenizer
public class ReadTextPrices2
{
public static void main(String[] args)
throws java.io.IOException
{
String fileName = "prices.txt";
int i;
double price;
String inLine, desc;
StringTokenizer st;
// set up a bufered input stream - notice the single statement used
BufferedReader br = new BufferedReader(new FileReader(fileName));
// read and display three lines
for (i = 0; i < 3; i++)
{
inLine = br.readLine();
st = new StringTokenizer(inLine);
desc = st.nextToken();
price = Double.parseDouble(st.nextToken());
System.out.println("Description: " + desc + '\t'
+ "Price: " + price);
}
br.close();
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -