Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

string object

 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 1252
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic