Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

When child class inherits from parents class should Protected attributes not be available to child?

former_member201275
Active Contributor

I have a protected attribute in my parent class. My child class inherits from parent class but I get error message "Access to protected attribute is not allowed".

Please advise. Thank you kindly in advance.

1 ACCEPTED SOLUTION

Hi Glen,

you have to access the attribute from inside the method of the child class.

The write you try to execute is from outside of the class and would need public access.

1 REPLY 1

Hi Glen,

you have to access the attribute from inside the method of the child class.

The write you try to execute is from outside of the class and would need public access.