PRASHNIKAप्रश्निका
Back to the paper

Consider the following code segment: class Car extends Vehicle implements Fourwheeler {.......}…

Computer Science20251 markMCQ
Consider the following code segment:
class Car extends Vehicle implements Fourwheeler
{.......}
Which of the following statements are valid for the given code? I. Vehicle is a super class and Fourwheeler is an interface. II. Interface cannot have abstract methods. III. Keyword extends applies to class and keyword implements applies to interface.
  • (a)Only I and II
  • (b)Only II and III
  • (c)Only I and III
  • (d)Only II

Answer

Answer

AI

Correct option: (c)

Answer: (c) Only I and III I is true: Vehicle is the superclass and Fourwheeler is an interface. III is true: 'extends' is used for inheriting a class and 'implements' is used for implementing an interface. II is false: an interface CAN have abstract methods (by default all its methods are abstract, unless declared default/static).
Inheritance, Interfaces and Polymorphism

From ISC 2025 Improvement Computer Science Paper 1, question 1(viii).