Forums Register Login

contentEquals()

+Pie Number of slices to send: Send
Could anyone tell me how to use contentEquals() function?
String s = "hello"; //line1
StringBuffer sb = new StringBuffer("hello"); //line2
System.out.println(s.contentEquals(sb)); //line3
Its giving me error at line 3
Thanks
+Pie Number of slices to send: Send
What error message do you get?
Is it something about an unknown method and are you using a JDK pre 1.4? If so, if you take a good look at The String Class Documentation, you'll notice that that method is "since 1.4".
What's brown and sticky? ... a stick. Or a tiny ad.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1588 times.
Similar Threads
contentEquals in java.lang.String
How to Compare StringBuffer object with String Object
a simple quiz on string equals
Question
StringBuffer
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 03:10:28.