您的位置:寻梦网首页编程乐园Java天地Core JavaJava Lecture Notes

Introduction

Content

Apply

Reflect

Extend

previous.gif
 (3087 bytes)

next.gif
 (2959 bytes)

 

Content Index

Content Page # 9

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

basicline.gif (169 bytes)

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