MCQ Single Best Answer Not Set

QWhich two classes use the Shape class correctly?
  
A. public class Circle implements Shape 
   {
    private int radius;
   }
B. public abstract class Circle extends Shape 
   {
    private int radius;
   }
C. public class Circle extends Shape 
   {
   private int radius;
   public void draw();
   }
D. public abstract class Circle implements Shape 
   {
    private int radius;
    public void draw();
   }
E. public class Circle extends Shape 
   {
    private int radius;
    public void draw()
    {
     /* code here */
    }
   }
F. public abstract class Circle implements Shape 
   {
     private int radius;
     public void draw() 
     { 
      /* code here */ 
     }
   }

ID: #2245 Inheritance in Java MCQ 9,170 views
Question Info
#2245Q ID
Not SetDifficulty
Inheritance in Java MCQTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A B,E
  • B A,C
  • C C,E
  • D T,H
Correct Answer: Option A

Explanation

If one is extending any class, then they should use extends keyword not implements.

Share This Question

Challenge a friend or share with your study group.