Importing a java class
The import statement is required in any file in which instances of the class if declared.import has not same effect than include:
- include: the included file becomes a part of the source before compilation.
- import: the declarations of the imported file become visible in the current source.
The java source must be compiled into bytecode with the .class extension before to be imported into a scriptol source.
The syntax is:
import java class-path
If "java" is a part of the class path, it may be ommitted.
Examples:
import
java java.awt.Dialog is
a valid declaration import java.awt.Dialog is valid also import java Dialog is not valid import Dialog is not valid for the Java class Dialog import MyClass is valid for a user class written in Java |