1 |
Objects are instances of Classes which form a template to allow definition of objects of the same type -- Classes are not objects although one can define static or class variables and methods which are shared by all instances of a class
|
2 |
The data of an object are called instance variables and they can be accessed for read or write via suitable methods which define the behavor of an object
|
3 |
/* Movable Point Class */
|
4 |
public class mPoint {
-
public int x, y; /* Instance Variable */
-
public int dx = 1, dy = 1; /* More Instance Variables */
|
5 |
Both class and its instance variables can be accessed by all other java objects
|