This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes string question Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "string question" Watch "string question" New topic
Author

string question

johny doe
Ranch Hand

Joined: Dec 07, 2007
Posts: 78
what is the difference between
building a String

String s="abc"
and
String s2=new String("abc");

what is the difference between
making s.equals(s2);
and
s==s2;
??
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 32657
    
    4
Somebody else asked a very similar question recently here. Does that answer your question?
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: string question
 
Similar Threads
string object
String creation
difference between poll memory and non-poll memory?
Strings and Things
Want the difference between String and StringBuffer