1).what is the difference between below examples

String s="vijay";

String s=new String("vijay");

Answer Posted / uday

Hi All,
Here one object is stored in the heap and you said that
you can change that, but bydefault String objects are
immutable(ReadOnly), how can u change it?

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Difference between this() and super() ?

749


What is the generic function?

713


Is there any tag in htm to upload and download files?

786


Differentiate between a class and an object.

752


What about interrupt() method of thread class ?

793






What is private static in java?

769


Is java a software?

691


What is basic syntax?

726


Differentiate between static and non-static methods in java.

771


What is the static method?

721


What is a null point?

725


Is arraylist sorted in java?

701


How list contains works in java?

723


How do you get length in java?

760


Explain different ways of creating a thread. Which one would you prefer and why?

779