Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

Package Access

  Asked By: Lisa    Date: Mar 14    Category: Java    Views: 645
  

How to run a program which is underlaying package accesss?
Simple

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Hattie Howard     Answered On: Mar 14

Try this :

if you have this code :

package toppackage;

import......

public class ClassA {
...
public static void main(String[] args)
}

compile it, and run  it (via command line) with java toppackage.ClassA
Don't forget to put the "toppackage" folder under yout classpath.
So, the steps :
1. create a folder which has same name with your package
("toppackage") in your classpath
2. write your codes at "toppackage" folder
3. compile your codes
4. run it

 
Didn't find what you were looking for? Find more on Package Access Or get search suggestion and latest updates.




Tagged: