Is there any way we can hide a method only for some classes in the same package? For example, this is my file structure:
MainFolder
- A.java
- B.java -> This class has some methods which can be accessed by 'A' and 'C' but not by 'D'
- C.java
- D.java
Moving them to the other package can be helpful but I was curious about it being in the same package as I didn't want to make new folders for a single file and would like to keep it organised.
- Is it possible to be achieved?
- If yes, then how?