aspose file tools*
The moose likes Beginning Java and the fly likes contentEquals() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "contentEquals() " Watch "contentEquals() " New topic
Author

contentEquals()

suresh kamsa
Ranch Hand

Joined: Jul 30, 2001
Posts: 149
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
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
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".


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: contentEquals()