Online Software Educational Training - IT Tutorials - Online Education Training for Computer Software


Home

JAVA PROGRAMMING

A Short example of package

Keeping the preceding discussion in mind, you can try this simple package

Here is a sample code using package





Call this file acbal.java, and put it in a directory called mypack.

Next compile the file. Make sure that the resulting .class file is also in the mypack directory. Then try executing the acbal class , using the following command line:

java mypack.acbal

Remmeber, you will need to be on the directory above mypack, when you execute this command, or to have your CLASSPATH environmental variable set appropriately.

 


Previous

Next