Skip to main content

Software > Software Development > IBM REXX Family >

NetRexx

Technical detail

Package instruction

package name;

where name is one or more non-numeric symbols separated by periods.

The package instruction is used to define the package to which the class or classes in the current program belong.

Classes that belong to the same package have privileged access to other classes in the same package, in that each class is visible to all other classes in the same package, even if not declared public. Packages also conveniently group classes for use by the import instruction.

The name must specify a package name, which is one or more non-numeric symbols, separated by periods, with no blanks.

There must be at most one package instruction in a program. It must precede any class instruction (or any instruction that would start the default class).

If a program contains no package instruction then its package is implementation-defined. Typically it is grouped with other programs in some implementation-defined logical collection, such as a directory in a file system.

Examples:

  package testpackage
package com.ibm.venta

When a class is identified as belonging to a package, it has a qualified class name, which is its short name, as given on the class instruction, prefixed with the package name and a period. For example, if the short name of a class is 'RxLanguage' and the package name is 'com.ibm.venta' then the qualified name of the class would be 'com.ibm.venta.RxLanguage'.

In the reference implementation, packages are kept in a hierarchy derived from the Java classpath, where the segments of a package name correspond to a path in the hierarchy. The hierarchy is typically the directories in a file system, or some equivalent (such as a 'Zip' archive file), and so package names should be considered case-sensitive (as some Java implementations use case-sensitive file systems).

 

 

PreviousTable of contents Next
We're here to help
Easy ways to get the answers you need.
E-mail us

or call us at
877-426-3774
Priority code:
104CBW67