package IO;
import java.io.*;
import java.util.ArrayList;
public class driver {
public static void main(String args[]) {
int s;
try {
//Scanner in = new Scanner(System.in);
//System.out.println("Enter The number of files you want to create");
//s = in.nextLine();
//takes the number of files
ArrayList<String> obj = new ArrayList<String>();
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter the number of files you want to create");
String num = br.readLine();
int x = Integer.parseInt(num);
// takes the names of file
for (int i = 0; i < x; i++) {
System.out.println("Enter the name for file:");
String name = br.readLine();
Integer.parseInt(name);
obj.add(name);
}
} catch (IOException o) {
System.out.println("Exception^^^^^^^^^^^^^");
}
}
}
这上面是我的代码,但是当我编译它像javac的driver.java然后Java驱动程序的命令行它给了我错误无法加载主类主...请帮我排序这个错误..这个代码btw包含文件处理,这将在稍后实施!编译错误 - 无法找到或Java错误负载类
[可能的复制(http://stackoverflow.com/questions/18093928/what-does-could-not-find-or-load-main-class-mean) – Deftwun
什么?请帮助我成功编译此代码。 –
你应该确实修复你的缩进。 – Zarwan