A

Admin • 828.70K Points
Coach

Q. Given the following piece of code:
public interface Guard{
void doYourJob();
}
abstract public class Dog implements Guard{ }

which of the following statements is correct?

  • (A) This code will not compile, because method doYourJob() in interface Guard must be defined abstract.
  • (B) When it doesn't make sense to have objects of that class.
  • (C) This code will not compile, because in the declaration of class Dog we must use the keyword extends instead of implements.
  • (D) This code will compile without any errors.
  • Correct Answer - Option(D)
  • Views: 23
  • Filed under category Java
  • Hashtags:

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.