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 the function of static in java?
What is data string?
What is variable explain with example?
What is the use of string and stringbuffer?
How transient variable is different from volatile variable?
What happens if an exception is throws from an object's destructor?
Is arraylist sorted in java?
What is a local class in java?
Can we override constructor?
Explain about GridBag Layout?
Which is not Object in Java?
Define package in Java.