• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How do I package stuff?

 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Okay I am not getting it ... what I am supposes to do to create packages and use them?

What should I be doing here?
 
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1- In JAVA the convention is to name packages with a starting lower case letter.
2- It is also the convention to name classes with a starting upper case letter.
3- For the JAVA class files that are located in folders or archives, their location in
the folder's hierarchy must follow their package names:
class a.b.c.D ( class D in the package a.b.c ) must have its file located like this:
a/b/c/D.class
So:
a- Rename 'fileLister.java' to 'FileLister.java'
b- Rename 'fileListerTest.java' to 'FileListerTest.java'
c- Edit the 'FileLister.java' file so it should read:

d- Edit the 'FileListerTest.java' file so it should read:

e- From the current root folder of this JAVA project, create a sub-folder 'fileLister'
f- Move the 2 .java files into that sub-folder.
g- From the current root folder of this JAVA project, do the following commands:
> javac fileLister/FileLister.java
> javac fileLister/FileListerTest.java
Cheers
JFB
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic