A class file was not written解决方法
来源:互联网 发布:上课玩手机神器淘宝 编辑:程序博客网 时间:2024/05/20 01:46
今天在学习泛型时,在泛型的构造方法使用中遇到了问题,如下
class Con<T>{private T value;public Con(T value) {this.value=value;}public T getValue() {return value;}public void setValue(T value) {this.value = value;}}public class GenericDemo4 {public static void main(String[] args) {Con<String> con = new Con<String>("在构造方法中使用泛型");System.out.println(con.getValue());}}首先定义了一个名为Con的类,并在构造方法中使用了泛型。然后Eclipse报了个错,错误信息为:A class file was not written. The project may be inconsistent, if so try refreshing this project and building it
查了一些答案,发现原因如下
下面是其他的一些保留字,在Windows下面都不能创建。注重,不许分大小写。Con,con,CON 都不可以!
con是操作系统保留的一个设备名字,还有很多设备名都不能拿来用,如下:
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).
所以在Windows系统下,将类名Con改为其他名字即可,在苹果电脑下则不会有此问题
原文链接:http://www.cnblogs.com/lostyue/archive/2011/07/13/2105190.html
0 0
- A class file was not written解决方法
- A class file was not written.
- A class file was not written.
- 菜鸟解决方法 A class file was not written. The project may be inconsisten
- A class file was not written. Eclipse+Java
- A class file not written.
- ERROR:A class was not written.
- Eclipse环境下a class file was not written问题的解决办法
- A class file was not written. The project may be inconsistent
- [Eclipse问题]A class file was not written. The project may be inconsistent
- 编译错误:A class file was not written. The project may be inconsistent, if so try refreshing this projec
- A class file was not written. The project may be inconsistent, if so try refreshing this project and
- 【rabbitmq】Warning: PID file not written; -detached was passed. ERROR: node with name "rabbit" alread
- file is not a zip file 解决方法
- org.apache.tomcat.util.bcel.classfile.ClassFormatException: It is not a Java .class file 的解决方法
- org.apache.tomcat.util.bcel.classfile.ClassFormatException: It is not a Java .class file 的解决方法
- null is not a java.class file
- vmware server FileNotFound: A file was not found
- 1.2.3.1 ISO/OSI参考模型
- poj3041
- android之SharedPreferences简介
- (三)、转义字符
- HDU 5800 To My Girlfriend
- A class file was not written解决方法
- hdu 1226(bfs+同余剪枝)
- 图,谱,马尔可夫过程,聚类结构[by林达华]
- HDU-1811-Rank of Tetris【拓扑排序】
- NYOJ 746 整数划分(区间DP)
- Qt - Debug
- 常见排序算法总结-C++实现
- Palindrome Partitioning学习
- 数据结构上机测试1:顺序表的应用