Monday, April 7, 2014

OCJP practice question #6

7:23 PM

String Tricky Question 

Solution: Option 4 is correct.
 " " in the System.out.println statement is empty String which is getting concatenated with s2. So new resultant will be stored in new location making a new Object, as String is immutable in java.

For more clarification Comment your queries in comment section of this post.

Happy learning :) 


Post a Comment


© 2014 DieHardTechy . All rights resevered. Designed by Diehardtechy