3-3練習(xí)題
int one = 10 ; ? ? ? ?int two = 20 ; ? ? ? ?int three = 0 ; ? ? ? ? ? ? ? ?three=one+two; ? ? ? ?three+=one; ? ? ? ?System.out.println("three=one+two==>"+three); ? ? ? ?System.out.println("three+=one==>"+three); 結(jié)果都是40為啥?
int one = 10 ; ? ? ? ?int two = 20 ; ? ? ? ?int three = 0 ; ? ? ? ? ? ? ? ?three=one+two; ? ? ? ?three+=one; ? ? ? ?System.out.println("three=one+two==>"+three); ? ? ? ?System.out.println("three+=one==>"+three); 結(jié)果都是40為啥?
2017-11-01
舉報(bào)
2017-11-03
你把順序調(diào)換一下,就清楚了:
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);