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
What is the memory leak in java?
What is the symbol for space?
How many types of constructors are used in java?
What is sortedset in java?
When do you call copy constructor?
how to run ecllipse with jettyserver for windows environment using batch file
What is number data type in java?
Can we sort hashset in java?
What is the impact of declaring a method as final?
Explain the difference between jvm and jre?
What is string pool?
Why is flag used in java?
What do you understand by overloading and overriding in java?
Can a class extend more than one class?
What will happen if there is a default method conflict as mentioned above and we have specified the same signature method in the base class instead of overriding in the existing class ?