This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Creating new Strings

 
jose chiramal
Ranch Hand
Posts: 266
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
String s ="abc" // Creates one String object and one reference variable. How ?

String s = new String("abc") // Creates two objects, and one reference variable. How ?

Can someone please explain the above two comments.
 
Pushkar Choudhary
Rancher
Posts: 425
Android Eclipse IDE Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This question has been asked many times. Please SearchFirst.

A couple of threads discussing the same here and here.
 
Yogesh Gnanapraksam
Ranch Hand
Posts: 133
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also this thread could be useful
http://www.coderanch.com/t/488922/Java-General/java/new-keyword-objects-Java#2199295
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic