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
Why do we declare a class static?
What are mutable classes?
What is the purpose of methodology?
Explain the features of interfaces in java?
Why spring singleton is not thread safe?
What will be the initial value of an object reference which is defined as an instance variable?
Why super is first line in java?
What was java originally called?
Why is multiple inheritance not supported in java?
Why we used vector class?
What is the difference between object oriented programming language and object based programming language?
Write a method that will remove given character from the string?
What is difference between == equals () and compareto () method?
What are the two environment variables that must be set in order to run any java programs?
What is the use of toarray () in java?