Thursday, 28 March 2019

UGC NET Computer Science July 2018 - II | Question 6

Question 6
6. 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.
Code :
  1. (1) S1 and S2 only
  2. (2) S1 and S3 only
  3. (3) S2 and S3 only
  4. (4) All of S1, S2 and S3
Answer : (1) S1 and S2 only
Explanation Question 6

  • Statement S1 is True → Final classes Prevent inheritance. So, final classes cannot be extended or inherited in java.
  • Statement S2 is True → A class can only inherit/extend one class but can implement multiple interfaces.
  • Statement S3 is False → Java permits a class to replace the implementation of a method that it has inherited. It is called method overriding.

Statements S1 and S2 are True statements

So, Option (1) is correct answer.

PreviousNext
UGC-NET CS 2018 July - II Question 5UGC NET CS 2018 July - II Question 7

No comments:

Post a Comment

UGC NET Computer Science December 2019 | Question 16

Question 16 In a certain coding language. 'AEIOU' is written as 'TNHDZ'. Using the same coding language. 'BFJPV' wil...

Popular Posts