Jump to content

How to get parent class


Recommended Posts

Posted

Now, there are two class A & B, B is inherits from A. All methods in B are  static.

And the question is that how  to get the parent class value by B or how to find the parent class which B inherited.

Posted (edited)

You cannot directly access the parent class from a child, you have to use accessor methods of the parent.

Regarding your second question, why do you need to know the parent?

Edited by Neil Pate

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.