)
System.out.println("result 1 = " + (literal1 == object) );
System.out.println("result 2 = " + literal1.equals(object));
System.out.println("result 3 = " + literal1 == object);
System.out.println("result 4 = " + literal1.equals(object));
System.out.println("result 5 = " + literal1 == literal2);
System.out.println("result 6 = " + literal1.equals(literal2));
The bottom line is:
1. If you have some function being called in JAVA, like literal1.equals(object), it will get executed first;
2. If you have a paranthesis expression like (expr), you will first execute that expression, then the rest;