Skip to Content

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

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.

protected.png (29.1 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Oct 12, 2017 at 06:21 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded