Get the tools you need to learn Java skills fast!
Video tutorials, eBooks, hands-on lab exercises, sample code.
Get started
The moose likes Beginning Java and the fly likes creating a java package Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Software Craftsman this week in the Agile forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "creating a java package" Watch "creating a java package" New topic
Author

creating a java package

Tex Abrey
Greenhorn

Joined: Oct 04, 2002
Posts: 24
How do you go about creating a java package. I need to create a package for this class so that i can import it into a jsp page.
Thanks
Greg Charles
Sheriff

Joined: Oct 01, 2001
Posts: 2867
    
  11

Just put a line at the top of the class definition like:
package mypackage;
Voila, instant package. The package is usually reflected in the file structure, so you may want to put this file into something like src/mypackage/MyClass.java, and the class should definitely go in something like classe/mypackage/MyClass.class.
[ March 26, 2003: Message edited by: Greg Charles ]
 
Have you tried LearnNowOnline? http://www.learnnowonline.com/
 
subject: creating a java package