#Access modifiers

1 messages · Page 1 of 1 (latest)

mental fossil
#

In a nutShell:Protected member not accessible through subclass object So i have a class named concrete in package say A1 then i have a class ConcreteSubClass (inheriting concrete) in package say A2 in the same file(as concreteSubclass) i have one last class Main. Here i am able to access the protected members of concerete in concretesubclass but not able to access them when i create a object of concreteSubclass in Main class in the same file Watch the video i shared for clarity

low ridgeBOT
#

This post has been reserved for your question.

Hey @mental fossil! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

mental fossil
cunning leaf
#

this is the access matrix

#

since Practice class is not a subclass of concrete it is not able to access protected method

low ridgeBOT
#

💤 Post marked as dormant

This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping.
Warning: abusing this will result in moderative actions taken against you.

mental fossil
# cunning leaf this is the access matrix

But I am not accessing it directly I am accessing it through the object of concrete subclass isn't the object of concrete subclass supposed to have copies of all the fields in it including the inherited ones

peak sluice
mental fossil
low ridgeBOT
#

💤 Post marked as dormant

This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping.
Warning: abusing this will result in moderative actions taken against you.