HELP! * GREY=local LOCAL HTML version of Foils prepared July 10 1996

Foil 59 The Java Object Model Overview

From Basic Lectures on Java Language Applets Graphics Networking Trip to China and Icase Tutorial -- July 12-28 and June 10-13 96. by Geoffrey C. Fox * Critical Information in IMAGE

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
The data of an object are called instance
variables and they can be accessed for
read or write if they are made public
/* Movable Point Class */
public class mPoint {
  • public int x, y; /* Instance Variable */
  • public int dx = 1, dy = 1; /* More Instance Variables */
Better design is "data encapsulation"; instance variables are not accessed directly, but access to all necessary values is made via methods of the class.



Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Tue Feb 18 1997