• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Abstract Method

 
Bin Zhao
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4467
3
Java Python Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you are correct the question was poorly worded.
 
Michael Ernest
High Plains Drifter
Sheriff
Posts: 7292
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:

    The Complete Java 2 Certification Study Guide


    [This message has been edited by Michael Ernest (edited November 22, 2000).]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic