• 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

Different classes in different directories.

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi...
Need some advice from the experts out there.. I have three classes i.e. main.class, readFile.class and writeFile.class that is needed to be put in different directories.
let's assumes that readFile and writeFile DIRECTORY is the subdirectory of main directory and the readFile.class and writeFile.class is in the directories respectively...
how do i get the codes in main.class to read the codes of readFile.class and writeFile.class ?
do i use a package or is there a better way to do it ?
am i able to "call" the classes e.g.

or is there another way to put the directory path of the class ?
 
Ranch Hand
Posts: 1514
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can have your readFile and WriteFile classes in a package and give them public access. If main class needs those classes, you can just "import" the appropriate package that they are in.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic