#笔记#第三章:操作符
打印
class d3_1{public static void main(String[] args){System.out.print("你妹");}}
?优先级
class d3_2{public static void main(String[] args){int x = 1, y = 2, z = 3;int a = x + y - 2 / 2 + z;int b = x + (y - 2) / (2 + z);System.out.print("a = " + a + "\nb = " + b);}}
?赋值
class Xx{int a;}class d3_4{public static void main(String[] args){Xx x1 = new Xx();Xx x2 = new Xx();x1.a = 1;x2.a = 2;System.out.print("x1a = " + x1.a + "\nx2a = " + x2.a);}}
?别名
class Xx{int a;}class d3_4_1{public static void f(Xx x){x.a = 10;}public static void main(String[] args){Xx x1 = new Xx();Xx x2 = new Xx();x1.a = 1;f(x2);System.out.print("x1a = " + x1.a + "\nx2a = " + x2.a);}}?