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 do you mean by of string::valueof expression in java 8?

543


Which sorting algorithm is best in java?

537


Can a boolean be null java?

545


Are arrays passed by reference in java?

492


Explain java coding standards for constants?

581






What is class??

761


State the difference between creating string as new () and literal.

525


What is identifier give example?

559


What is an array in java?

640


Implement 2 stacks with just 1 array. The stack routines must not indicate overflow unless every slot in array is used.

836


Can we write class inside a class in java?

553


Is string a wrapper class?

519


Wha is the output from system.out.println(“hello”+null); ?

696


What are 3 boolean operators?

539


What is role of void keyword in declaring functions?

580