赋值运算符
= += -= *= /= %=
a=3;a=a+b;
x=y=z=7;//不建议
ax=b; a=axb;x代表+ - * / %
赋值运算符
= += -= *= /= %=
a=3;a=a+b;
x=y=z=7;//不建议
ax=b; a=axb;x代表+ - * / %
赋值运算符:
= += -= *= /= %=
a = 3; a = a + b;
x = y = z = 7;//不建议
a x = b; ======> a = a x b x代表 + - * / %
public class Assignment{
public static void main(String[] args){
int a = 3;
int x,y,z;
x = y = z = 4;
a += 4;//a = a +4;
System.out.println(a);
a -= 5;
System.out.println(a);
a *= 4;
System.out.println(a);
a /= 2;
System.out.println(a);
a %= 7;
System.out.println(a);
}
}
public class Assignment{
public static void main (String [] args){
int a = 3;
int x,y,z;
x = y = z = 4;
a += 4;//a = a + 4;7
System.out.println(a);
a -= 5;//2
System.out.println(a);
a *= 4;//8
System.out.println(a);
a /= 2;//4
System.out.println(a);
a %= 7;//4
System.out.println(a);
}
}
赋值运算符:
赋值运算符
a x=b; ==== a=axb;
x代表+ - * / %