Ok, the next one is easy... Of course, nobody is supposed to write code like that, but it's very likely that one day somewhere you'll get to maintain poorly written code. So it doesn't hurt starting right now
What happens when the following code is compiled and run?
As usual, you should try to compile and run the code mentally without using any compilers and JVM.
change the line: String=String to this.String=String the O/P comes "Hello World" this is because in String=String the compiler takes both the String as local varialble of that function and overwrites the value of Local String variable with the same value... when local variable and class variable has the same name and "this" is not used to distinguish b/w local and class variable the compiler gives preference to local variable [ November 07, 2006: Message edited by: Priyam Srivastava ]
"History would be kind to me, for I intend to write it."