Calling grandfather class methods

Hi everyone,

I need to call a method for a class up in the hierarchy.  That has similar meaning to super.super.method1();

parent of the parent's method1

Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

sciuriwareConnect With a Mentor Commented:
You can't.
There's 3 ways of doing this:
1) just call the inherited method,
2) have the super class call   super.method() for you,
3) make it static so it is accessible by class name.
Tommy BraasCommented:
Hi The14follower,

Unless you're able to do the first of sciuriware's suggestion, I would contend that there is a problem in your class design. You might be better off fixing the class hierarchy, rather than trying to hack your specific need.

May be this question is raised because it's possible in C++ which is, for that matter, a very confusing feature:

     class C : B ....

     class B : A ....

in C:
          A::function() .....

The14followerAuthor Commented:
Thank you very much.  That will save my time trying to do nothing.
All Courses

From novice to tech pro — start learning today.