Question discussion

A method declared final in a Java class cannot be

2368Medium DSSSB TGT Computer Science 0 replies

A method declared final in a Java class cannot be

  • Aoverloaded in the same class
  • Boverridden in a subclass
  • Cinherited by a subclass
  • Dcalled from a static method
Correct answer: B

Explanation

A final method can be inherited, overloaded and called, but a subclass is not allowed to override it.

Discussion 0

Nobody has replied yet. Start the discussion!