All mock tests are FREE till 31 December — register to save your progress

In Java, which of the following statements is/are True ?

S1 : The ‘final’ keyword applied to a class definition prevents the class from being extended through derivation.

S2 : A class can only inherit one class but can implement multiple interfaces.

S3 : Java permits a class to replace the implementation of a method that it has inherited. It is called method overloading.

Pick an option to check yourself, or open the answer below.

Show answer & explanation

Correct answer: A. S1 and S2 only

Explanation

A final class can't be extended (S1), and Java has single class inheritance with multiple interfaces (S2). Replacing an inherited method is overriding, not overloading, so S3 is false.

More Programming Languages and Computer Graphics questions