import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class Print { public static void main(String[] args) throws IOException { final String name = "keyboard.txt"; Print print = new Print(); print.printKeyBoard(name); } public void printKeyBoard(final String name) throws IOException { OutputStream outputStream = new FileOutputStream(name); for (int i = 32; i <= 126; i++) { outputStream.write(i); } outputStream.close(); InputStream inputStream = new FileInputStream(name); for (int i = 0; (i = inputStream.read()) != -1;) { System.out.print((char) i); } inputStream.close(); } }
打印出键盘上的所有数字、大小写字母和标准符号
最新推荐文章于 2024-11-03 11:01:20 发布