English

What is a member variable?

Advertisements

Question

What is a member variable?

Short Answer
Advertisements

Solution

A member variable in Java is a variable declared inside a class but outside any method, constructor, or block. It is used to store data related to the class or its objects. Member variables can be instance variables or static (class) variables, depending on whether they are declared with the static keyword.

shaalaa.com
  Is there an error in this question or solution?
Chapter 6: Variables and Expressions - SHORT ASSIGNMENTS [Page 136]

APPEARS IN

Dheeraj Mehrotra Computer Science [English] Class 12
Chapter 6 Variables and Expressions
SHORT ASSIGNMENTS | Q 29. | Page 136
Advertisements
Share
Notifications



      Forgot password?
Use app×