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
How do you convert an int to a double in java?
What does mean in regex?
What is the use of protected in java?
How will you reverse a singly-link list?
Are generics important java?
What’s the difference between unit, integration and functional testing?
What is sizeof in java?
What is java util function?
What is the difference between preemptive scheduling and time slicing?
How hashset works internally in java?
What is volatile data type?
Can we nested try statements in java?
What does serializing data mean?
Can we override a variable in java?
What are instance variables?