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 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

Abstract Method

Bin Zhao
Ranch Hand

Joined: Oct 04, 2000
Posts: 73
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: 4351

you are correct the question was poorly worded.

Visit my download page
Michael Ernest
High Plains Drifter

Joined: Oct 25, 2000
Posts: 7292

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

    The Complete Java 2 Certification Study Guide

    [This message has been edited by Michael Ernest (edited November 22, 2000).]

Make visible what, without you, might perhaps never have been seen.
- Robert Bresson
I agree. Here's the link:
subject: Abstract Method
It's not a secret anymore!