File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Abstract Method 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 "Abstract Method" Watch "Abstract Method" New topic
Author

Abstract Method

Bin Zhao
Ranch Hand

Joined: Oct 04, 2000
Posts: 73
TRUE OR FALSE
An abstract method must be specified inside an abstract class only
in a mock exam,the anwser said it's true.
But I think a method declared in an interface is also an abstract
method,isn't it?
Am i wrong with this porblem?
Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4340
    
    2

you are correct the question was poorly worded.


SCJP
Visit my download page
Michael Ernest
High Plains Drifter
Sheriff

Joined: Oct 25, 2000
Posts: 7292

The Mock exam answer is simply incorrect:
<CODE>
public interface TryThis
{
public abstract void testMethod();
}
</CODE>
This compiles without a hitch. Given the wording of the statement, the answer is simply False.
-----------------
Michael Ernest, co-author of:


Make visible what, without you, might perhaps never have been seen.
- Robert Bresson
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Abstract Method