Multiple choice technology architecture

Which of the following statements accurately describe the use of access modifiers within a class definition?

  1. They can be applied to both data & methods

  2. They must precede a class's data variables or methods

  3. They can follow a class's data variables or methods

  4. They can appear in any order

  5. They must be applied to data variables first and then to methods

Reveal answer Fill a bubble to check yourself
A,B,D Correct answer
Explanation

Access modifiers (public, private, protected) can be applied to both data fields and methods. They precede the member declaration and can appear in any order relative to other modifiers like static or final. The statement that they can follow data variables is incorrect.