I am facing some difficulties with this package concept of Java. Let's assume I have the following two directory structures.
dir1
|___com
|___example
|___mypackage
|___myclass.class
dir2
|___com
|___example
|___mypackage
|___myclass.class
So both the myclass.class
files are part of com.example.mypackage
. Now if both dir1
and dir2
are on CLASSPATH
and I write import com.exaple.mypackage.myclass
, which path will be considered?