writetextprices.java
来自「《A first book of java》by Gary J.Bronson 」· Java 代码 · 共 20 行
JAVA
20 行
import java.io.*;
public class WriteTextPrices
{
public static void main(String[] args)
throws java.io.IOException
{
// set up the basic output stream
FileWriter fw = new FileWriter("prices.txt");
// buffer it for faster output
BufferedWriter bw = new BufferedWriter(fw);
// this provides a set of useful methods
PrintWriter pw = new PrintWriter(bw);
pw.println("Mats 39.95");
pw.println("Bulbs 3.22");
pw.println("Fuses 1.08");
pw.close();
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?