public class HelloWorld{
public static void main(String[] args) {
int one = 10 ;
int two = 20 ;
int three = 0 ;
int three0 =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");three /= one;
System.out.println("three");three %= one;
这样对吗?为什么显示出来全是three?
因为你输出函数里的three是字符串,注意"three",表示你这里是一个字符串常量。去掉""后,就是变量了,就能显示变量three的值
this is Constant,is not Variable.