What modifier should you use on a class so that a class in the same package can access it but a class (including a subclass) in
a different package cannot access it?A. publicB. privateC. protectedD. Use the default modifier.
1 answer:
Answer:
Option (B) is the correct answer of this question.
Explanation:
In the Private access modifier we can access the property and field within the package or class we cannot accessing the member outside the class .
- We use private keyword for declaring the private access modifier.
- In the public access modifier we accessing the property outside the class so it's a incorrect option .
- In the protected access modifier we access the property of class package and subpackage both so it's a incorrect option.
- The default modifier is incorrect it not follow the given scenario so it's incorrect.
You might be interested in
Answer:
I believe the answer you're looking for is "PNG"
Explanation:
Answer: the MAC (Media Access Control) address
(ERP) Enterprise Resource Planning software. Good luck! :)
Answer: Buisness calendars
Explanation:
Answer:
You can see their expression and emotions rather than just typing words out on the computer.