class a_2
{
public static void main(String[] args)
{
int[][]arr={{3,5,1,7},{2,3,5,8},{6,1,8,2,}};
int sum=0;
for(int x=0;x<arr.length;x++){
for(int y=0;y<arr[x].length;y++){
sum=sum+arr[x][y];
}
}
System.out.println(sum);
}
}
运行时出错,如下:
/**Exception in thread "main" java.lang.NoClassDefFoundError: 1
Caused by: java.lang.ClassNotFoundException: 1
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Could not find the main class: 1. Program will exit.
*/ |
|