Win a copy of Kotlin in Action this week in the Kotlin forum!
    Bookmark Topic Watch Topic
  • New Topic

String questions  RSS feed

 
palanisamy subramani
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Report post to moderator
String stringNameOne = "CodeRanch";
String stringNameTwo = new String("CodeRanch");

Can you please clarify, What is the difference between stringNameOne and stringNameTwo in terms of object creation and memory and which is the best.
 
Wouter Oet
Bartender
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
  • Report post to moderator
This question has been asked many times. Jesper de Jong posted a couple of links to related topics which you can find here. Or use the search.
 
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!