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