Which of the following access modifiers allows a member to be accessed from anywhere?
- default (no modifier)
- private
- protected
- public
In Java, the public access modifier allows a member to be accessed from anywhere, including outside the class, package, and even from different packages. It provides the highest level of accessibility. The other options restrict access to varying degrees.
Loading...
Related Quiz
- What is the primary advantage of using an ExecutorService to manage threads?
- The ________ class in Java creates an immutable sequence of characters.
- To retrieve the value of the first column in the current row of a ResultSet, you can use the method ________.
- In a scenario where order of the elements based on their insertion order is important, you might opt to use ________.
- How does autoboxing and unboxing affect performance, especially in collections that deal with primitive data types?