posted 18 years ago
Any string that you create in java will be a treated as object..... for example as
String str1 = "abc"; implicitly the string "abc" will be an object!!...
and also this is the short-hand form to create any immutable string .
you can create a string in two ways:
1) String str1 = "abc";
2) String str1 = new String("abc");
the difference is that , for the first , you are creating just only one object (i.e "abc") and for the second , you are creating two objects (i.e str1,a reference object and "abc");
thats it... you can use either way......