Question #192389

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


Expert's answer

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



LATEST TUTORIALS
APPROVED BY CLIENTS