Re: can't call super from method but I need to??
- From: "caultonpos@xxxxxxxxx" <caultonpos@xxxxxxxxx>
- Date: Sun, 30 Dec 2007 18:51:54 -0800 (PST)
On Dec 30, 6:32 pm, Daniel Pitts
<newsgroup.spamfil...@xxxxxxxxxxxxxxxxxxx> wrote:
caulton...@xxxxxxxxx wrote:
See below, how can I call animals growl while within a method of my
interface (I need that - cant get rid of it).
public class animal {
public void growl() {
System.out.println("growl");
}
}
public class dog extends animal {
public void growl() {
IDefaultCall default = new IDefaultCall () {
public void execute() {
// I can do it this as super. points to IDefaultCell !
super.growl();
}
};
call (default);
}
}
First, class names should be UpperCase.
I think the syntax you're looking for is something like dog.super.growl();
--
Daniel Pitts' Tech Blog: <http://virtualinfinity.net/wordpress/>- Hide quoted text -
- Show quoted text -
Yes I just typed here in lowercase.
Even if it looks like a static method call that syntax works, learn
something every day.
.
- Follow-Ups:
- References:
- can't call super from method but I need to??
- From: caultonpos@xxxxxxxxx
- Re: can't call super from method but I need to??
- From: Daniel Pitts
- can't call super from method but I need to??
- Prev by Date: Re: Use of AssertionError
- Next by Date: Re: Great SWT Program
- Previous by thread: Re: can't call super from method but I need to??
- Next by thread: Re: can't call super from method but I need to??
- Index(es):
Relevant Pages
|