State The state of an object is defined by its instances variables.
Behavior An object behavior is defined by its methods. They change the state of the object's instance variables to create new states.
class Point extends Object { public double x; public double y; Point() { x = 0.0; y = 0.0; } Point(double x, double y) { this.x = x; this.y = y; } }
Copyright © 1998-2009 Dilvan Moreira