suppose string s1="rajnish";
string s2="bhaskar";
then what will be happend ?

Answer Posted / ravi jain

2 new string objects will be created in String pool area in JVM.

String are immutable that why they are stores in

different area in JVM

as in case of final variables.

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the order of arraylist in java?

594


What is a flag variable?

546


Discuss about garbage collector in Java.

624


Is void a keyword in java?

576


Which list does not allow duplicates in java?

502






How do I print a “?

561


How do you check if two given string are anagrams?

541


Is empty .java file name a valid source file name?

571


What do you mean by buffering?

539


What is nullpointerexception?

541


Can you instantiate the math class in Java?

595


How many ways can we create singleton class?

488


What is the purpose of the enableevents() method?

569


What steps are taken when the OS shifts from one-thread execution to another?

887


What is meant by oops concept in java?

492