The general form of a package definition directive : package « Language « Flash / Flex / ActionScript






The general form of a package definition directive

 

package packageName {
}

To add a class to a package

package packageName {
  Class source code goes here
}
To create a new class: use a class definition

class Identifier {
}

package com.java2s {
  class MyClass {
  }
}

        








Related examples in the same category

1.To gain access to all the public classes in another package.
2.Global Scope: Code placed directly outside a package body or at the top-level of a package body resides in the global scope.
3.package level function
4.Packages groups classes
5.Variables, functions, and namespace declarations can also be contained inside packages.
6.A package-level function
7.Import all the classes in a particular package by using the wildcard operator (*) trailing the package name
8.References to the classes by using their full name