What are field variables?

Options
- Variable declared within a method
- Variable declared outside a constructor but inside a class
- Both b and d
- Variable that is declared as a member of a class


CORRECT ANSWER : Both b and d

Discussion Board
Field Variables

Field variable is also known as instance variable as it is defined in the class as a member variable for each object of the class. They al have separate copy or instances of the class. It is quite different from the class variable and it is not defined using the Static variable declaration modifier as per the class variable.

The instance variable is declared in the class, and may be given a default value. Instance variables store the current value of the objects which class don't know about. All instances have their own copy of variables and other required values.

Rohit Sharma 08-9-2014 08:19 PM

Write your comments


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)


Advertisement