How do I import Java package in script?
Category: javax.script, viewed: 1468 time(s).
Here you can see how to import a Java class so that you can use the class, creates an instance of
it in the scripting environment. We want to print out the current date on the console. For this we
need to import the Date class that's packaged under the java.util package.
In the script we can import the java.util package using the following script
importPackage(java.util).
This program prints the following line:
Today is Fri Sep 11 2009 17:03:02 GMT+0800 (CST)
Can't find what you are looking for? Join our FORUMS and ask some questions!
Download Hundreds of Complimentary Industry Resources
Get hundreds of popular Industry magazines, white papers, webinars, podcasts, and more;
all available at no cost to you. With more than 600 complimentary offers, you'll find
plenty of titles to suit your professional interests and needs.
Click Here and Sign up today!
