[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: WO40: Unable to access application level functions..



Anupindi, Ravikiran wrote:
> I have a function  'public void xyz()' defined in Application.java file. And
> I am trying to call this function from a different java class (abc.java). I
> am getting a message saying "Error:Method xyz() not found in class
> com.apple.yellow.webobjects.WOApplication"

> public void foo() {
>         WOApplication currentApp = (WOApplication)this.application();
>         currentApp.xyz();
> }
> 
> Any ideas why this is happening ?

You probably did the wrong casting operation, try this:

  Application app = (Application)this.application();
  app.xyz();

Java is statically typed, so the receiver of a message must declare the
operation (the WOApplication class doesn't support xyz, but your
concrete subclass, Application, does).

Helge
--
MDlink online service center
http://www.mdlink.de/