哪里錯啦,我無語死了
public class HelloWorld{
? ? public static void main(String[] args) {
? ?int one = 10 ;
? ? ? ? int two = 20 ;
? ? ? ? int three = 0 ;
? ? ? ? three=one+two;
? ? ? ? System.out.println("three = one +two ==>",+three);
? ? ? ? three+=one;
? ? ? ? ?System.out.println("three +=one ==>",+three);
? ? ? ? three-=one;
? ? ? ? System.out.println("three -=one ==>",+three);
? ? ? ? three*=one;
? ? ? ? System.out.println("three *=one ==>",+three);
? ? ? ? three/=one;
? ? ? ? System.out.println("three /=one ==>",+three);
? ? ? ? three%=one;
? ? ? ??
? ? ? ??
? ? ? ? System.out.println("three %=one ==>",+three);
? ? ? ??
? ? ? ??
? ? ? ??
? ? ? ??
? ? ? ??
? ? ? ??
? ? ? ??
? ? ? ??
? ? ? ??
? ? ? ??
? ? ? ??
? ? ? ??
? ? ? ??
? ??
}
}
2017-09-17
將System.out.println("xxx",+xx);改為System.out.println("xxx"+xx);即可。(去掉逗號)
2017-09-17
解決了,上述第二個問題是我重復(fù)定義了。謝謝大家
2017-09-17
HelloWorld.java:9: error: variable one is already defined in method main(String[])
? ? ? ?int one = 10 ;
? ? ? ? ? ?^
HelloWorld.java:10: error: variable two is already defined in method main(String[])
int two = 20 ;
? ?^
HelloWorld.java:11: error: variable three is already defined in method main(String[])
int three = 0 ;
? ?^
3 errors
2017-09-17
不要逗號
2017-09-17
?把打印信息中的逗號去掉,字符創(chuàng)拼接不需要逗號,如下:
2017-09-17
把println()方法中的逗號去掉