当前位置: 技术问答>java相关
求助!!程序错误!请大虾近来看看!!
来源: 互联网 发布时间:2015-09-12
本文导语: C:Program FilesXinox SoftwareJCreator ProMyProjectsitTheListEtc.java:102: 在 java.lang.System 中的 getProperties() 不能被应用到 (java.lang.String) String newline=System.getProperties("line.separator"); ...
C:Program FilesXinox SoftwareJCreator ProMyProjectsitTheListEtc.java:102: 在 java.lang.System 中的 getProperties() 不能被应用到 (java.lang.String)
String newline=System.getProperties("line.separator");
^
C:Program FilesXinox SoftwareJCreator ProMyProjectsitTheListEtc.java:122: 不能解析符号
符号:类 parseDouble
位置:类 in java.lang.Double
double m=new Double.parseDouble(str1);
我不知道怎么错了
请指点一下!!
String newline=System.getProperties("line.separator");
^
C:Program FilesXinox SoftwareJCreator ProMyProjectsitTheListEtc.java:122: 不能解析符号
符号:类 parseDouble
位置:类 in java.lang.Double
double m=new Double.parseDouble(str1);
我不知道怎么错了
请指点一下!!
|
double m=new Double.parseDouble(str1);
parseDouble()返回的是double值,不是对象,不用new。从另一个方面来讲,你定义的m也是double,不用new的。
parseDouble()返回的是double值,不是对象,不用new。从另一个方面来讲,你定义的m也是double,不用new的。
|
1:System.getProperties() returns a Properties not a String. You should use getProperty() instead.Otherwise you call getProperties() to get all the properties you wanted, the returned value is an array of Property. Then use the returned Property to get the String value through get method(Property extends from hashtable).
2:Double.parseDouble() is a static method, so your syntax is wrong. You just use double m = Double.parseDouble() directly.
2:Double.parseDouble() is a static method, so your syntax is wrong. You just use double m = Double.parseDouble() directly.
您可能感兴趣的文章:
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。