• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Code implementation of verbal description

 
Thomas Hauck
Ranch Hand
Posts: 95
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The following question was taken from a Whizlabs exam.

68. Which two are wrong? (Choose two options.)

A. If abstract class B directly extends abstract class A, class B must implement all abstract methods declared in A.
B. An abstract class CANNOT be instantiated.
C. An interface can extend multiple interfaces.
D. All methods in an abstract class must be abstract.
E. If concrete class C extends concrete class B, and B implements interface A, then all methods from interface A can be invoked on an instance of C.

Answer : A, D


For option E) which was not one of the answers, I wanted to know if the following code would be an accurate "code implementation" of the verbal description.



Please confirm.
 
Paul Clapham
Sheriff
Posts: 21559
33
Eclipse IDE Firefox Browser MySQL Database
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
C is concrete? Check. C extends B? Check. B is concrete? Check. B implements A? Check. All of A's methods (i.e. the only one) can be invoked on an instance of C? If your code compiles, then Check.

In other words, yeah, you got it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic