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.
A friendly place for programming greenhorns!
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
»
Java in General
Author
String and StringBuffer
jose chiramal
Ranch Hand
Joined: Feb 12, 2010
Posts: 266
posted
May 26, 2010 07:54:59
0
public static void main(String args[]) { String s1 = new String("abc"); String s2 = new String("abc"); StringBuffer sb1 = new StringBuffer("def"); StringBuffer sb2 = new StringBuffer("def"); System.out.println(s1.equals(s2)); System.out.println(s1==s2); System.out.println(sb1.equals(sb2)); // why does this give me false ? System.out.println(sb1==sb2); }
Joanne Neal
Rancher
Joined: Aug 05, 2005
Posts: 3011
9
posted
May 26, 2010 08:35:47
0
Did you try searching ? The same question was asked in the Beginners forum a few days ago.
Joanne
Jesper de Jong
Java Cowboy
Bartender
Joined: Aug 16, 2005
Posts: 12911
3
I like...
posted
May 26, 2010 08:42:01
0
Here
; no need to discuss the exact same question all over again.
Java Beginners FAQ
-
JavaRanch SCJP FAQ
-
The Java Tutorial
-
Java SE 7 API documentation
Scala Notes
- My blog about Scala
I agree. Here's the link:
http://zeroturnaround.com/jrebel
- it saves me about five hours per week
subject: String and StringBuffer
Similar Threads
What would be the output?
about String & StringBuffer
Difference of equals method in string and stringbuffer
string buffer
arguments to method
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter