Prashnikaप्रश्निका
Code
About
‹ Back to the paper

Question 1(viii)

1 mark

Computer ScienceISC 2025 Improvement Computer Science Paper 1MCQInheritance, Interfaces and Polymorphism

Choose the correct option.

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

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

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).