1).what is the difference between below examples
String s="vijay";
String s=new String("vijay");
Answer Posted / ravikiran
first one will create an object on the heap
second one will create two objects one will saved on the
heap and another will get saved on the string pool
Is This Answer Correct ? | 0 Yes | 6 No |
Post New Answer View All Answers
Can sleep() method causes another thread to sleep?
Explain the term virtual machine?
Can singleton class be serialized?
Why is string buffer better than string ?
How do you join strings in java?
what is difference between equals and ==?
How variables are stored in memory?
How will you print number in reverse (descending) order in BST.
How do I get a substring?
What is exception propagation?
How do you sort a string in alphabetical order in java?
What is garbage collection? What is the process that is responsible for doing that in java?
How many bytes is a string java?
When throw keyword is used?
What is a variable simple definition?