difference between String a; and String a=new String();?
y do v need to assign memory to the variable?

Answer Posted / janardhan

String a; :---

JVM will create String object in SCPM(String constant pool
memory)only.

String a=new String();:---

JVM will create String object in two memories
1. Heap memory
2. String constant pool memory.

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are meta-annotations?

553


What does a za z0 9 mean?

560


Can we use this () and super () in a method?

527


Is string is a class in java?

519


What is the basic concepts of OOPS?

684






Can you override a final method?

578


How will you invoke any external process in java?

600


we have syntax like for(int var : arrayName) this syntax is to find whether a number is in the array or not.but i want to know how to find that number's location.

1568


Is null false in java?

704


What is stored procedure. How do you create stored procedure ?

1490


What is autoboxing in java?

605


Why Do I Get A "permission Denied" Error After Downloading The .jnlp Java Launcher For The Vkvm?

622


Define how can we find the actual size of an object on the heap?

650


Can we override constructor?

534


Explain the use of volatile field modifier?

631