i1 == i3; is indeed an invalid statement. But it is a valid expression that returns true, which is why this option is correct. (All of the given options are just expressions.)
You may try this:
boolean b = (i1 == i3);
System.out.println(b);
I can see that the answer explains in the end - Note that constructors of wrapper objects such as Integer have been deprecated (marked for removal since Java 9), but moreover it also gives compilation error in IDE.
So boolean expressions involving i2 may want to be disregarded in the correct options I would think?
>but moreover it also gives compilation error in IDE.
Don't use IDE for testing code while preparing for certification exam because they give different errors than command line tools. https://enthuware.com/oca-ocp-java-cert ... cation-ide