1).what is the difference between below examples
String s="vijay";
String s=new String("vijay");
Answer Posted / navneet raushan
the first case does: if u write first case , one object and
one refernce will be created. object will be created in
string pool.
But when u write 2nd case , two object and one refernce
will be created , one in string pool and one in heap.
| Is This Answer Correct ? | 1 Yes | 4 No |
Post New Answer View All Answers
How do you convert int to char in java?
List out benefits of object oriented programming language?
Explain about main() method in java ?
Can we rethrow the same exception from catch handler?
What is use of inner class in java?
What’s the difference between the methods sleep() and wait()?
Why Java is not pure Object Oriented language?
What is a singleton in genetics?
Is alive and join method in java?
What is the final blank variable?
What do you mean by append?
What is an array in java?
Why is method overloading not possible by changing the return type in java?
Is string thread safe in java?
Can we extend singleton class?