Comunitatea PHP Romania
 

 
Core JavaScript Reference 1.5:
Previous     Contents     Index     Next     
Core JavaScript Reference 1.5





JavaPackage

A JavaScript reference to a Java package.


Core object  

 

Implemented in  

JavaScript 1.1, NES 2.0  


Created by
A reference to the package name used with the Packages keyword:

Packages.JavaPackage

where JavaPackage is the name of the object's Java package. If the package is in the java, netscape, or sun packages, the Packages keyword is optional.


Description
In Java, a package is a collection of Java classes or other Java packages. For example, the netscape package contains the package netscape.javascript; the netscape.javascript package contains the classes JSObject and JSException.

In JavaScript, a JavaPackage is a reference to a Java package. For example, a reference to netscape is a JavaPackage. netscape.javascript is both a JavaPackage and a property of the netscape JavaPackage.

A JavaClass object is a reference to one of the classes in a package, such as netscape.javascript.JSObject. The JavaPackage and JavaClass hierarchy reflect the Java package and class hierarchy.

Although the packages and classes contained in a JavaPackage are its properties, you cannot use a for...in statement to enumerate them as you can enumerate the properties of other objects.


Property Summary
The properties of a JavaPackage are the JavaClass objects and any other JavaPackage objects it contains.


Examples
Suppose the Redwood corporation uses the Java redwood package to contain various Java classes that it implements. The following code creates the JavaPackage red:

var red = Packages.redwood


See also
JavaArray, JavaClass, JavaObject, Packages


Previous     Contents     Index     Next     
Copyright © 2000 Netscape Communications Corp. All rights reserved.

Last Updated September 28, 2000

Ultimele discutii in forum RSS Forum

Ultimele articole Ultimele articole

Top membri

Pirahna Pirahna
la birou
carco carco
Bucuresti
Birkoff Birkoff
Bucuresti
Mascka Mascka
Braila
raul_ raul_
whooper whooper
Toronto ON
mihaitha mihaitha
Sibiu
gabysolomon gabysolomon
Bacau
oriceon oriceon
Constanta
garlicinicolae garlicinicolae

Newsletter


Email:
 inscriere
 renuntare
 
 Arhiva newsletter

Parteneriat

Copyright © 2001-2008 PHP Romania Add PHPRomania to Google Add PHPRomania to Del.icio.us Add PHPRomania to Stumbleupon Add PHPRomania to Yahoo! Add PHPRomania to Digg Add PHPRomania to Blink Movie Downloads | Loans | Loans | Best Credit Cards | Personal Finance
Ads: Partener Way2Web Nework: gazduire web | inregistrare domenii | web design | imobiliare | web hosting
Powered by Simplis