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
What are computer functions?
Can we make constructors static?
Explain about public and private access specifiers?
What are annotations in java?
how we can make a read-only class in java?
What is passed by reference and pass by value ?
What is meant by distributed application? Why are we using that in our application?
Where and how can you use a private constructor?
Can we declare array without size in java?
What is json parser in java?
What is meant by data hiding in java?
What is use of valueof () in java?
What are the various access specifiers for java classes?
What is default constructors?
What is finalize()?