⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readjava.java

📁 里面包含了多个java的编程示例!而且举出初学者常常遇到的错误!
💻 JAVA
字号:
import java.io.*;

public class ReadJava {
    public static void main(String[] arguments) {
        if (arguments.length < 2)
            System.out.println("Usage: java ReadJava filename1 filename2");
        else {
            try {
                File inFile = new File(arguments[0]);
                FileInputStream in = new FileInputStream(inFile);
                File outFile = new File(arguments[1]);
                FileOutputStream out = new FileOutputStream(outFile);
                boolean eof = false;
                while (!eof) {
                    int input = in.read();
                    if (input == -1) {
                        eof = true;
                    }
                    else {
                        out.write(input);
                    }
                }
                in.close();
                out.close();
            } catch (IOException e) {
                System.out.println("Error -- " + e.toString());
            }
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -