1).what is the difference between below examples
String s="vijay";
String s=new String("vijay");
Answers were Sorted based on User's Feedback
Answer / ravikiran
first one will create an object on the heap
second one will create two objects one will saved on the
heap and another will get saved on the string pool
| Is This Answer Correct ? | 0 Yes | 6 No |
Answer / p.sreekiran
in first string class it create in heep memory and second
is created object in constant memeory we cannot change the
second one
| Is This Answer Correct ? | 2 Yes | 13 No |
What is regex in java?
What is thread safe java?
What are java packages? What's the significance of packages?
Can we declare the static variables and methods in an abstract class?
What is a key in java?
What is method with example?
What is a vector in java?
Can we use catch statement for checked exceptions when there is no chance of raising exception in our code?
what release of java technology are currently available what do they contain?
what are the jsp tags with example?
What is a null point?
what is an objects lock and which objects have locks? : Java thread