This week's giveaway is in the EJB and other Java EE Technologies forum. We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line! See this thread for details.
Hi Wasim, I don't have a copy of the code but if by 'it is in the same directory' you mean the compiled class file is in the same directory as the class marked package B you will get a compile error. If you have two source files, one marked 'package A;' and another marked 'package B' your directory set up should be
You then need to compile from the 'root' directory using
Java expects the package naming to follow the directory structure. 'package A' instructs the compiler to look for the source file in the 'A' subdirectory. 'package B' instructs the compiler to look for the source file in the 'B' subdirectory. It searches for the subdirectories in the current directory. Hope that helps. ------------------ Jane Griscti Sun Certified Programmer for the Java� 2 Platform