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 is vector capacity in java?
How is java hashmap implemented?
Can we create an object of static class in java?
What is data member in java?
What is meant by bytecode?
What is charat ()?
What is concurrent hashmap and its features?
What is the difference between C++ and Java and your preferences?
Why to use nested classes in java? (Or) what is the purpose of nested class in java?
What is a lambda expression ? What's its use ?
Is it safe to install java on my computer?
What is meant by class loader? How many types are there? When will we use them?
What are the disadvantages of object oriented programming?
Can singleton class be cloned?
How can we run a java program without making any object?