為什么這段代碼沒有閉合給它加了兩個 } 反而不行了
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);
? ? ? ? three+=one;
? ? ? ? ?System.out.println(three);
? ? ? ? three*=one;
? ? ? ? ?System.out.println(three);
? ? ? ? three/=one;
? ? ? ? ?System.out.println(three);
? ? ? ? three%=one;
? ? ? ? System.out.println(three);
為什么這段代碼沒有閉合給它加了兩個 } 反而不行了
2018-12-03
是不是回車按多了,}}在最下面你看不到?
2018-12-03
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);
? ? ? ? three+=one;
? ? ? ? ?System.out.println(three);
? ? ? ? three*=one;
? ? ? ? ?System.out.println(three);
? ? ? ? three/=one;
? ? ? ? ?System.out.println(three);
? ? ? ? three%=one;
? ? ? ? System.out.println(three);
? ? }
}
最后兩個這么加就好了