To evaluate an expression, the operands are evaluated 1st. So, when the expression
ga.i+" "+ga.getI() is to be evaluated, the method invocation is done 1st and since its a classic case of run-time
polymorphism, the subclass method getI() is run printing "Sub" and returning 2.
The Java programming language also guarantees that every operand of an operator (except the conditional operators &&, ||, and ? : ) appears to be fully evaluated before any part of the operation itself is performed.
The above quote is from the below link.
http://java.sun.com/docs/books/jls/second_edition/html/expressions.doc.html