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 A question about equals 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 "A question about equals" Watch "A question about equals" New topic

A question about equals


Joined: Jul 10, 2001
Posts: 11
Which methods can be legally applied to a string object?
the answer is a b c d e
my question is focus on a.
because i have viewd the api for jdk1.3 and i merely find the method of equals(Object obj) at the the class of String.So i think the answer shouldn't include a.
my english is poor so i don't know if i explain clearly.
Scott Appleton
Ranch Hand

Joined: May 07, 2001
Posts: 195
A String "is an" Object and is therefore a legal argument to any method which takes an Object as a parameter.
Junilu Lacar

Joined: Feb 26, 2001
Posts: 6529

Also, d is incorrect. You cannot round() a String.

Junilu - [How to Ask Questions] [How to Answer Questions]

Joined: Jul 10, 2001
Posts: 11
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
Hi gnome986,
Please read the JavaRanch Name Policy and re-register using a name that complies with the rules.

Thanks for your cooperation.

Co-Moderator of the Programmer Certification Forums

Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
I agree. Here's the link:
subject: A question about equals
It's not a secret anymore!