File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes equals( ) method from String class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "equals( ) method from String class" Watch "equals( ) method from String class" New topic

equals( ) method from String class

mrudul joshi
Ranch Hand

Joined: Nov 12, 2003
Posts: 54
Hi everybody,
I want to know whether the following method
boolean equals (Object obj)
throws the ClassCastException if the argument object is not of class String or does the language itself converts non-string object into its string representation internally?
Thanks in advance for your inputs.
Harsha Kalva

Joined: Dec 23, 2003
Posts: 1
String.equals(Object) returns false if Objects is not a String

I agree. Here's the link:
subject: equals( ) method from String class
jQuery in Action, 3rd edition