filmov
tv
Java Tutorial 39 - Classes and Objects 1-2

Показать описание
Classes
- A class is a template, blueprint, or contract.
- A class defines the state and behaviors for objects.
Objects
- An object is an instance of class.
- An object represents an software entity uniquely in the real world.
Class Object
data fields state / properties / attributes
methods behaviors / actions / operations
constructors
e.g.,
Object State Behavior
window name minimize, maximize, close, open, new
lamp on, off turn on, turn off
tv on, off, turn on, turn off, volume up, volume down,
volume, channel channel up, channel down
- A class is a template, blueprint, or contract.
- A class defines the state and behaviors for objects.
Objects
- An object is an instance of class.
- An object represents an software entity uniquely in the real world.
Class Object
data fields state / properties / attributes
methods behaviors / actions / operations
constructors
e.g.,
Object State Behavior
window name minimize, maximize, close, open, new
lamp on, off turn on, turn off
tv on, off, turn on, turn off, volume up, volume down,
volume, channel channel up, channel down