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
when to use ArrayList and when to use HashMap in webApplication.
What is static keyword in java?
Can a constructor call the constructor of parent class?
how to create multithreaded program? Explain different ways of using thread? When a thread is created and started, what is its initial state? : Java thread
What is one third plus one third as a fraction?
How do you create a first line indent?
When a thread is executing a synchronized method , then is it possible for the same thread to access other synchronized methods of an object ?
which pattern is default in scanner package?
Java is pass by value or pass by reference? Explain
Write a java program that prints all the values given at command-line.
can java object be locked down for exclusive use by a given thread? Or what happens when a thread cannot acquire a lock on an object? : Java thread
What will happen if static modifier is removed from the signature of the main method?
What is java oops?
What are heterogeneous objects?
What is arrays aslist in java?