Question 45Asked in DSSSB TGT Computer Science (Technical), 7 Aug 2021, Shift 3

Which of the following statement is/are correct regarding JAVA programming?

Which of the following statement is/are correct regarding JAVA programming? I. A class marked as final cannot be inherited II. A method marked final cannot be overridden
  1. AOnly I
  2. BOnly II
  3. CBoth I and II
  4. DNeither I nor II
Show answerHide answer

Correct answer: (C) Both I and II

Explanation

In Java, a final class cannot be subclassed and a final method cannot be overridden. Both are correct.

From DSSSB TGT Computer Science PYQ (Technical), 7 Aug 2021, Shift 3

This is question 45 of DSSSB TGT Computer Science PYQ (Technical), 7 Aug 2021, Shift 3. See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.