public class WriteDemo {
public static void main(String[] args) throws IOException {
//创建一个字节输出流
OutputStream out = new FileOutputStream("D:\\dy.txt");
BufferedWriter buf = new BufferedWriter(new OutputStreamWriter(out));
for (int x = 0; x < 5; x++) {
for (int y = 0; y <4; y++) {
//System.out.print("*");
buf.write("*");
}
buf.newLine();
//System.out.println();
}
buf.close();
}
}
把*替换成99乘法表的打印方式就可以了 |