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
Can we convert stringbuilder to string in java?
What is the effect of keeping a constructor private?
What's the difference between comparison done by equals method and == operator?
What does snprintf return?
What methodology can be utilized to link to a database?
What is the largest data type in java?
What is unmodifiable collection in java?
what are the high-level thread states? : Java thread
What is the maximum size of a string in java?
Write a code to create a trigger to call a stored procedure
What is a local class in java?
What is a java lambda expression?
Can we initialize the final blank variable?
What is the difference between numeric and integer?
Is java a security risk?