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
How do you escape a string?
What was java originally called?
Why we cannot override static method?
Garbage collection in java?
Difference between method overloading and overriding.
What is identifier give example?
What do you understand by synchronization?
What is the difference between synchronized and synchronized block?
Explain try and catch keywords in java?
What is the difference between compiler and jvm?
Find the value of a specified element of the array arr[i] where 0 <= i <= n-1
What is Java Annotations?
Explain about doubly linked list
What does %d do in java?
what is the difference between the methods sleep() and wait()? : Java thread