readprices.java
来自「《A first book of java》by Gary J.Bronson 」· Java 代码 · 共 29 行
JAVA
29 行
import java.io.*;
public class ReadPrices
{
public static void main(String[] args)
throws java.io.IOException
{
String fileName = "prices.dat";
// set up the basic input stream
FileInputStream fis =
new FileInputStream(fileName);
// buffer it for faster input
BufferedInputStream bis =
new BufferedInputStream(fis);
// this provides a set of useful methods
DataInputStream dis =
new DataInputStream(bis);
System.out.println("The values read from the " + fileName
+ " file are:");
System.out.println(dis.readDouble());
System.out.println(dis.readDouble());
System.out.println(dis.readDouble());
dis.close();
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?