Examples of 'new’ statements
In the example below, 'aMenu' is the name of a
particular object of class Menu. Note the brackets after the name of the class; their
significance is explained later this unit:
Menu aMenu = new
Menu();
Consider the following statement:
new
Applet();
a specific object (of class Applet) is created,
but it never gets assigned to a variable. This object must be entirely self-contained, as
the method that creates it has no way of communicating with it after creation.
Back to top

RITSEC - Global Campus
Copyright ?1999 RITSEC- Middlesex University. All rights reserved.
webmaster@globalcampus.com.eg
|