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 are class,constructor and primitive data types?
How do I stop concurrentmodificationexception?
What are java packages? What is the significance of packages?
Can I import same package/class twice?
What is the meaning of 3 dots in java?
types of applets?.
What is low level language in computer?
Is namespace same as package in java?
Can a class have more than one object?
What is equlas() and hashcode() contract in java? Where does it used?
What is the difference between exception and error in java?
What are structs in java?