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 the advantages and disadvantages of object cloning?
Is oracle charging for java?
What is null in java?
Explain about map interface in java?
Differentiate between postfix and prefix operators in java.
Why array is used in java?
What is an empty class? What functionality does it offer in Java?
Can a class with private constructor be extended?
What is a buffer in computer?
Is call by reference possible in java?
What are the various access specifiers in java?
Give an example of use of pointers in java class.
Explain how hashmap works?
What are the different http methods?
What do u mean by variable?