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
Can we define a package statement after the import statement in java?
Explain purpose of sleep() method in java?
How hashmap increases its size in java?
How do you write a scanner class in java?
how to convert Java project into Maven ?
What is arraylist class in java?
What are the different ways of creating thread?
Explain about member inner classes?
What is the difference between iterator and list iterator?
What is java algorithm?
When object is created and destroyed?
What does \ mean in regex?
Is upper case in java?
How to change the priority of thread or how to set priority of thread?
How many types of memory areas are allocated by JVM in java?