I am trying to build a java project from command line with the following directory structure :
proj/ Makefile Main.java lexer tokens ast interpreter lib
I assume that Main.java has access to all
annotations of all the four folders. But, if I want to use the
tokens package, is there any way to do so ? By way, I mean what access specifiers should I use to fulfill my use case ?
LINKS which I used before asking this question :
Thanks in advance.
EDIT : Main can import from packages and main is in default package.
Assuming you are using java8 and before:
Mainwill not have access to all classes and enum by default
Mainwill have access to classes and enums defined within
- A method in
Mainwill have access to inner classes and enums
Mainwill have access to classes and enums defined as
publicin other packages
Mainwill have access to classes that it is extending in other packages(they should be atleast protected)
Similar access policy will be followed for other classes too. (Main has nothing special)