SCJP Java Script
Saturday, 16 March 2013
SCJP - 2 - Which declare a compilable abstract class? (Choose all that apply.)
2. Which declare a compilable abstract class? (Choose all that apply.)
A. public abstract class Canine { public Bark speak(); }
B. public abstract class Canine { public Bark speak() { } }
C. public class Canine { public abstract Bark speak(); }
D. public class Canine abstract { public abstract Bark speak(); }
Answer
:
B is correct. abstract classes don't have to have any abstract methods.
A is incorrect because abstract methods must be marked as such. C is incorrect because
you can't have an abstract method unless the class is abstract. D is incorrect because the
keyword abstract must come before the classname. (Objective 1.1)
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment