Javacaozuofu.html" target="_blank">操作符这块知识,以前只是一扫而过,今天再次看到《Java编程思想》的操作符这一章,看了一会,觉得还是有点文章的,于是整理了点内容如下(不全是操作符的知识),理解其中错误之处。(小弟初来乍到,大手留情)
?
public class Test { public static void main(String[] args){ int x++=0; int +x=0; int -x; int x=3++; float f=3.04; float f=3.04f; float f=(f++)+-5; float f=(f++)-+5; float f=(f++)--; float f=(f+3)++; float f=-f++; float f=f+++-5; float f=f---+5; int x=10,y=5; float f=x*--y; float f=x*-y; System.out.println(f); int x=y=1; int x=1,y=1; System.out.println(x==y); System.out.println(x.equals(y)); A a1=new A(); A a2=new A(); System.out.println(a1==a2); System.out.println(a1.equals(a2)); System.out.println(a1.x==a2.x); System.out.println((a1.x).equals(a2.x)); System.out.println("a1.x="+a1.x+++";a2.x="+a2.x); } } class A{ static int x=1; }