Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

equals( ) method from String class

 
mrudul joshi
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
Mrudul
 
Harsha Kalva
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
String.equals(Object) returns false if Objects is not a String
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic