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

The14followerAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
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.
;JOOP!
0
 
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.

\t
0
 
sciuriwareCommented:
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() .....

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

From novice to tech pro — start learning today.