這個代碼可以過,但他運轉結果是什么?
public class HelloWorld{
? ? public static void main(String[] args) {
? ?int one = 10 ;
? ? ? ? int two = 20 ;
? ? ? ? int three = one+two ;
? ? ? ? int three += one;
? ? ? ? int three -=one;
? ? ? ? int three *=one;
? ? ? ? int three %=one;
? ? System.out.println("one"):
? ? }
}
2015-07-19
three聲明過數據類型,就不用反復的聲明數據類型。
所以這里全部的數據類型int去掉。
輸出語句最后是;,不是:。加引號是輸出字符串,不加引號是輸出變量。
2015-08-01
運算結果就是10