Multiple choice technology programming languages

For Object A to access method of object B, and the method has no modifier, Object A must be an instance of class which is ...

  1. Same package as B

  2. In different package

  3. mark a default acess modifier to the class

  4. None

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

In Java, methods with no access modifier (default/package-private) are only accessible to classes within the same package. For Object A to access a default-access method of Object B, both must be in the same package.