public class Con {
public static void main(String... args){
System.out.println("CSDN");
}
}
运行环境
Eclipse 3.2 for windows
JDK 6.0 u4
我把static 加上了,免得误导!!
...全文
21125打赏收藏
大家猜一下这个类的运行结果是什么?
public class Con { public static void main(String... args){ System.out.println("CSDN"); } } 运行环境 Eclipse 3.2 for windows JDK 6.0 u4 我把static 加上了,免得误导!!
答案:
你根本不能创建一个名字为Con的.java文件,在ecilispe里面,如果类名被修改为Con,会出现
A class file was not written. The project may be inconsistent, if so try refreshing this project and building it
The following reserved device names cannot be used as the name of a file: CON, PRN, AUX, CLOCK$, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, and LPT9. Also avoid these names followed by an extension (for example, NUL.tx7).