求组下面的代码:[code=java]import java.io.File ;
import java.io.OutputStream ;
import java.io.FileOutputStream ;
public class OutputStreamDemo01{
public static void main(String args[]) throws Exception{
File f = new File("e:" + File.separator + "JavaTest" + File.separator + "ch12" + File.separator + "tttttttttt.txt");
OutputStream out = null;
out = new FileOutputStream(f);
String str = "北京欢迎你!!";
byte b[] = str.getBytes();
out.write(b);
out.close();
}
}[/code]运行后报出错误:
Exception in thread "main" java.lang.NoClassDefFoundError: OutputStreamDemo01
Caused by: java.lang.ClassNotFoundException: OutputStreamDemo01
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:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Could not find the main class: OutputStreamDemo01. Program will exit. |