Back to Course
Java for Selenium

Access and non-access modifiers

Access Modifiers

  • private: accessible only within the same class.
  • default: accessible within the same package.
  • protected: accessible within the package and by subclasses.
  • public: accessible from anywhere.

Non-Access Modifiers

  • static: belongs to the class rather than an instance.
  • final: prevents a variable from being reassigned, or a method/class from being overridden/extended.
  • abstract: marks a class or method as incomplete, requiring a subclass to implement it.

Ready to master real-world software testing?

Learn manual and automation testing hands-on with mentor-led sessions.

Explore Course