This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
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

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
It's not a secret anymore!