Consider the following directory structure:
The two files main.java
and maintest.java
are on different locations on disk and yet they declare the same package.
Since they declare the same package name, does this mean they are the in the (virtually)same package i.e. java compiler views them as one package and treats them as such, or are they differentiated in some way, if so how?
Also, considering that we declared a static method called printdate
in main.test, how would we import the main.java
's public class and use the printdate
method in maintest.java
?