The Fields are the parts of an Object and hold state or one or
information about an Object. In the above illustration, computer ON or OFF
indicates the state of the object.
But how a computer will retain this information?
Variable for the fields: The Variables are used to hold those
information you want a computer to keep in it's memory to be used as
needed. These are categories of variables you need to know.
- Change or No Change:
- Non-Static Variables: You expect that the state of information
may change time to time.
- Static Variables : You want to use a constant value all the
- Local Variable :
- Public Variable.
- Protected Variable
- Use against an Argument (parameter). Often you send
Variables while calling another method, that has a set of rule
to expect some inputs from the callers. For the details follow this