4. Which access modifier can prevent methods of a class being overridden? Please select "A, B, C, D, or E" as correct option.Â
A. public
B. private
C. static
D. protected
E. final
You can use private, static and final modifier to prevent method overriding, but you should always use final modifier to prevent overriding. Final is best way to say a method is complete and can't be overridden.
Answer:
E. final
Comments
Leave a comment