✏️ Explanatory Question

How do access modifiers in X++ affect the visibility of class members?

👁 78 Views
📘 Detailed Answer
🟢 Easy
💡

Answer with Explanation

In X++, access modifiers determine the visibility of class members (variables and methods). The three access modifiers are:

  • Private: The variable or method is only usable within the class it is defined in.
  • Protected: The variable or method is usable within the class it is defined in and any subclass of that class.
  • Public: The variable or method is usable anywhere. If no modifier is provided, the default is public.