is there any diff between parseXXX() and xxxValue()
Yes.
parseXXX returns a primitive
xxxValue returns a wrapper object
what is the precedence given in the system.out.println() stmt
The expression that gets passed to println() will be evaluated normally before the result is passed to the println method, so all the usual precedence rules apply. Consider this example:
The output is:
28.25hello722.0[one, two]
28.25hello722.0[one, two]
3 + 5 evaluates to 8.
d evaluates to 2.25.
8 + 2.25 evaluates to 10.25.
2 * 9 is grouped because * has higher precedence than + so JVM evaluates 2 * 9 to 18.
10.25 + 18 evaluates to 28.25.
28.25 + "hello" evaluates to "28.25hello"
"28.25hello" + 7 evaluates to "28.25hello7"
11.0 * 2 is grouped because * has higher precedence that + so JVM evaluates 11.0 * 2 to 22.0.
"28.25hello7" + 22.0 evaluates to "28.25hello722.0"
list is an object reference, so JVM knows to invoke list.toString() implicitly to evaluate list as an operand for the
String concatenation operator +
list.toString() returns "[one, two]"
"28.25hello722.0" + "[one, two]" evaluates to "28.25hello722.0[one, two]"
The completed String "28.25hello722.0[one, two]" gets passed as a single argument to println()