Question

Where can a protected field be seen that a package field cannot?

Where can a protected field be seen that a package field cannot?
0 0
Add a comment Improve this question Transcribed image text
Answer #1

`Hey,

Note: Brother in case of any queries, just comment in box I would be very happy to assist all your queries

Every method can access protected fields of its own class, and all its parent classes.Variables, methods, and constructors, which are declared protected in a superclass can be accessed only by the subclasses in other package or any class within the package of the protected members' class. Protected access gives the subclass a chance to use the helper method or variable, while preventing a nonrelated class from trying to use it.

Kindly revert for any queries

Thanks.

Add a comment
Know the answer?
Add Answer to:
Where can a protected field be seen that a package field cannot?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT