1).what is the difference between below examples
String s="vijay";
String s=new String("vijay");
Answer Posted / karun
In first statement String s = "vijay"
Means it will create a single instance and single reference
variable
but in second statement
String s = new String("vijay");
Means it will create a two instances and single reference
variable
| Is This Answer Correct ? | 4 Yes | 7 No |
Post New Answer View All Answers
Can an interface extend a class?
What are internal and external variables?
What is the list interface in java programming?
Explain the polymorphism principle?
Explain the concept of proper inheritance?
What is the use of 'super' keyword inside a constructor?
What are new features introduced with java 8 ?
How to do encapsulation in java?
what happens when a thread cannot acquire a lock on an object? : Java thread
Difference between overriding and overloading in java?
Write code of any action class?
What's the purpose of using break in each case of switch statement?
How to set the permissions to a file in java?
What are the different conditional statements?
What does split function do in java?