Monday, January 4, 2010

InnerClass

Final method-local variables are accessible to method-local inner classes while non-final method-local variables are not accessible to the same.

No clue!!!

Let the bit-representation of 'a' be
1111 1111 1111 1111 1011 1010 1101 0111.
What will be the result of
(short) a >> 3
ANS: 1110 0111 0101 1010
What is this : a string + a boolean in the place of the ternary condition?

String s = "DIAMOND";
boolean red = true;
s += red ? ":red" : ":black";