Re: can't call super from method but I need to??



caultonpos@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/>
.



Relevant Pages

  • Re: How to use generics?
    ... getting rid of the ACollection and BCollection and just having Collectionwould be a good start towards using generics to the full extent. ... public void AddCollection() ... public bool ContainsKey ...
    (microsoft.public.dotnet.languages.csharp)
  • program challenge
    ... public void setName{ ... the salaried class that extends Employee ... public class Salaried extends Employee ... // Programmer.java: the programmer class that extends from Hourly ...
    (comp.lang.java.help)
  • Re: Tricky form problem
    ... > ShowDialog method) different modal child forms. ... when using ShowDialog() there's no ... > public class MainForm: Form ... > public void ShowForm() ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: InvalidOperationException was unhandled
    ... > public Vehicle MyVehicle; ... >public class Vehicle ... > public void SerializeOriginal(String filename) ...
    (microsoft.public.dotnet.vjsharp)
  • RE: Problem: C# custom event is null
    ... public event MyDelegate OnFire; ... public void B_Event_Raised ... (these are sample classes to illustrate) ...
    (microsoft.public.dotnet.languages.csharp)