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
What is the difference between an if statement and a switch statement?
What is native method in java?
Is java good for beginners?
Why parameters should be passed by reference?
What is constructor chaining and how is it achieved in java?
What is a package in java? List down various advantages of packages.
What are the basic control structures?
Difference between Preemptive scheduling vs. Time slicing?
What is finally and finalize in java?
What is math in java?
What is nested loop? What is dangling else condition in it?
How to store image in arraylist in java?
What is the ==?
What is a class variable?
What is tree in java?