File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Accessing the base class methods in child class. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Accessing the base class methods in child class." Watch "Accessing the base class methods in child class." New topic
Author

Accessing the base class methods in child class.

shan raj
Ranch Hand

Joined: Dec 16, 2008
Posts: 42
Hi,

Below is the code snippet. I want to call the func1() of class A in class C. if I use super.func1(), the class B method will be called. But I want to call func1() of class A. Can any one tell me how to call the func1() in class C in proper way.

Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10451
    
    8



[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Sebastian Janisch
Ranch Hand

Joined: Feb 23, 2009
Posts: 1183
There is already a discussion about that. Check Invoke Grand-Parent Method


JDBCSupport - An easy to use, light-weight JDBC framework -
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39395
    
  28
Sebastian Janisch wrote:There is already a discussion about that. . . .
Good idea to quote that discussion. I seem to remember that thread also says such coding would be bad design.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Accessing the base class methods in child class.