Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / December 2007

Tip: Looking for answers? Try searching our database.

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

Thread view: 
caultonpos@gmail.com - 30 Dec 2007 23:12 GMT
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);
  }

}
Daniel Pitts - 30 Dec 2007 23:32 GMT
> See below, how can I call animals growl while within a method of my
> interface (I need that - cant get rid of it).
[quoted text clipped - 19 lines]
>
> }
First, class names should be UpperCase.

I think the syntax you're looking for is something like dog.super.growl();

Signature

Daniel Pitts' Tech Blog: <http://virtualinfinity.net/wordpress/>

caultonpos@gmail.com - 31 Dec 2007 02:51 GMT
On Dec 30, 6:32 pm, Daniel Pitts
<newsgroup.spamfil...@virtualinfinity.net> wrote:
> caulton...@gmail.com wrote:
> > See below, how can I call animals growl while within a method of my
[quoted text clipped - 29 lines]
>
> - 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.
Lew - 31 Dec 2007 03:04 GMT
Daniel Pitts
>> First, class names should be UpperCase.

> Yes I just typed here in lowercase.

Yes, that would be the reason Daniel drew your attention to it.

Signature

Lew



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.