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
What is the primary benefit of encapsulation?
What does sizeof return?
What is the common usage of serialization?
Why do we use string?
What is a get method?
What is main in java?
What are the principle concepts of oops?
What is difference between identifier and variable?
What is the difference between a method and a function in alice?
What do you understand by garbage collection in Java? Can it be forced to run?
Explain the use of shift operator in java. Can you give some examples?
Is integer immutable in java?
What is the hashcode () and equals () used for?
Can we use static class instead of singleton?
How can you share data between two thread in Java?