How can we call a class in directory by a class in another directory by writing class paths

Showing Answers 1 - 2 of 2 Answers

kohina

  • Nov 17th, 2007
 

Suppose 'A' directory has 'class x'  and ' B '  directory  has ' class y '  then while compling the x class give the classpath of class y . Even while running the class x the class path of y should be specified.(hope that 'y' is not dependent on x. compile y before 'x')

../ex>javac  x.java  -classpath = ../B

  Was this answer useful?  Yes

sreenivas reddy

  • Nov 26th, 2007
 

We should set the class path otherwise we can't compile the java program.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions