[JBoss-dev] calling a super method implementation

Emmanuel Bernard emmanuel.bernard at jboss.com
Wed Jul 26 17:41:37 EDT 2006



I don't know how to (or if it's even possible to) call by reflection a 
super implementation of a given method

public class SuperA {
 public void testDisplay() {
    System.out.println("SuperA");
 }
}

public class A extends SuperA {
 public void testDisplay() {
    System.out.println("A");
 }
}

SuperA.class.getDeclaredMethod("testDisplay", new Class[] 
{}).invoke(aInstance, new Object[] {});
will actually display 'A'

I'd like to display 'SuperA'

Any help apreciated





More information about the jboss-development mailing list