Advertise Here

Author Topic: [JavaTutorial] Packaging  (Read 3684 times)

0 Members and 1 Guest are viewing this topic.

Offline Marsada

  • SMF For Free Newbie
  • *
  • Posts: 4
  • Java Assistant
    • View Profile

  • Total Badges: 9
    Badges: (View All)
    Topic Starter Combination Level 2 Level 1 First Post
[JavaTutorial] Packaging
« on: February 09, 2009, 08:35:49 pm »
[JavaTutorial] Packaging

Requirements: Folders(Not many)

*You will be able to acess java files a lot quicker than before.
*Your Java Project will look a lot cleaner than before.

The main code for packaging is package.

How to locate java files with packaging?
If your java file is located in the, lets say myfolder1, your package code will look like this(package myfolder1;)

Example of a package:
Code: [Select]
package packaging.myfolder1;

/*packaging.myfolder1; is the same as (folder)packaging>(folder)myfolder1;
 *so basically your java file should be located in myfolder1

public class HelloPackage {

public static void main(String[] args) {
System.out.println("Hello Package!");

Running the packaged file.
You can compile and run, but thankfully i have provided you with the package of my own which you can download.
(It has a compiled java file with a successful runner.)
(Any of them are fine)

Thats about it for this tutorial.Thank you for visiting it.

*Copyright Marsada(c)


Related Topics

  Subject / Started by Replies Last post
4 Replies
Last post October 11, 2005, 12:03:25 am
by Prasad007
1 Replies
Last post February 09, 2009, 04:51:01 pm
by Colette Brunel
0 Replies
Last post February 09, 2009, 07:57:56 pm
by Marsada