Computer Applications
A member variable declared with a public access specifier has visibility in …………… .
- Class
- Package
- Subclass
- All of these
Encapsulation & Inheritance in Java
3 Likes
Answer
All of these
Reason — A member variable declared with a public access specifier has visibility in the class, its sub classes and the package as well.
Answered By
2 Likes
Related Questions
…………… is the technique of binding both data and methods together to keep them safe from unauthorised access and misuse.
- Abstraction
- Inheritance
- Encapsulation
- Polymorphism
Which of the following is an access specifier?
- public
- protected
- private
- All of these
A member variable declared with a private access specifier has visibility only in the …………… .
- Class
- Package
- Subclass
- All of these
A member variable declared with no access specifier has visibility in …………… .
- Class and package only
- Class, package and subclass only
- Class and subclass only
- Class only