This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
    Bookmark Topic Watch Topic
  • New Topic

string object

 
arivu mathi
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Report post to moderator
String s = new String("abc");
String s = "abc";

will the above two statements create a new string object?
what is the difference between the two statements?
 
Shaan Shar
Ranch Hand
Posts: 1249
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Report post to moderator
Originally posted by arivu mathi:
String s = new String("abc");
String s = "abc";

will the above two statements create a new string object?
what is the difference between the two statements?


I am sure that you haven't visited JAVA Ranch Properly...

Check this out..
Strings, Literally- JAVA Ranch.

This link will be usefull for you...

For more check out this also..

Java Beginners Faq
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
  • Report post to moderator
We seem to be having a leetle problem with the bulletin board at the moment. I'm closing this one for now - it looks like a double post but it is not intentional.
 
    Bookmark Topic Watch Topic
  • New Topic