楼主:
wkt (Q_______Q)
2015-02-04 00:42:31public static void main(String[] args) {
String Output = "1234";
System.out.println(Output.charAt(0));//此行print出来确实为1
if (Output.charAt(0).equals('1')){ //此行出错!!?
System.out.println("D=1");
}
else{
System.out.println("D!=1");
}
Exception讯息如下:
Exception in thread "main" java.lang.RuntimeException: Uncompilable source
code - Erroneous sym type: <any>
我把"1234"这个字串以charAt方法提取出第0字符但是似乎不能用equals方法做比较??
请问各位神人有什么好方法可以解救一下不才......