Discussion Forum : Introduction To Methods And Streams
Question -

Which of these keywords can be used to prevent Method overriding?

Options:
A .  static
B .  constant
C .  protected
D .  final
Answer: Option D

To disallow a method from being overridden, specify final as a modifier at the start of its declaration. 

Methods declared as final cannot be overridden.



Was this answer helpful ?
Next Question
Submit Your Solution hear:

Your email address will not be published. Required fields are marked *