A method or a data member which is declared as ________ is accessible to all classes in the Java program.
- default (package-private)
- private
- protected
- public
In Java, when a method or data member is declared as "public," it is accessible to all classes, regardless of their location in the program. This is the highest level of visibility, and it allows unrestricted access from any part of the program.
Loading...
Related Quiz
- To specify a repeating behavior in an animation, ______ method is used in JavaFX.
- What does the Future interface represent in Java concurrency?
- When reading from a file using a FileReader, it's often wrapped with a ________ to increase efficiency.
- Which sorting algorithm uses a divide-and-conquer strategy to sort data?
- The ________ class is used to display a color picker in JavaFX.