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 a pointer and does java support pointers?
What is a string token?
What is considered an anti pattern?
What is byte code and why is it important to java’s use for internet programming?
How are variables stored?
What is meant by the value of a variable?
What does += mean in java?
How to display all the prime numbers between 1 and n (n is the number, get the input from user)
Make a data structure and implement an algorithm to print all the files in a directory. (The root directory can have sub-directories too.)
Why hashmap is used in java?
How to reverse string in java?
What is string data?
What are dot operator queries?
What is the use of list in java?
What is the diffrence between inner class and nested class?