class Demo1_Operator {
public static void main(String[] args) {
//赋值运算符
int a = 3; //把右边的常量值赋值给左边的变量.左边必须是变量
a += 4; //a = a + 4;
a -= 2; //a = a - 2;
a *= 10; //a = a * 10;
a /= 10; //a = a ÷ 10
System.out.println("a = " + a);
}
}
Day2 笔记 赋值运算符的基本用法
- admin
- 0