Computer Applications
An instance variable …………… .
- needs an instance to access it
- does not need an instance to access it
- can be accessed using the class name
- is declared with the static keyword
Encapsulation & Inheritance in Java
1 Like
Answer
needs an instance to access it
Reason — An instance variable needs an instance (object) to access it as each instance of the class has a separate copy of the instance variable.
Answered By
1 Like
Related Questions
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
A static variable …………… .
- is preceded by static keyword in the declaration
- is accessed via the class name
- is also known as a class variable
- All of the above
…………… is the feature by means of which one class acquires the properties of another class.
- Abstraction
- Inheritance
- Encapsulation
- Polymorphism