(Choose 1 answer)
Which of the following statements is incorrect about access modifiers?
A. The public access modifier can be used only for methods.
B. It is recommended to define class instance variables as private variables since it achieves the encapsulation property of object-oriented design.
C. protected methods can be accessed only by derived classes of the class that implemented the protected methods.
D. If an instance variable is defined with a public access modifier, then that instance variable can be accessed by all classes.
Exit 40