Help with compiler error: method in class X cannot be applied to class Y

Discussion in 'Java' started by Petterson Mikael, Oct 8, 2003.

  1. Hi,

    I am trying to compile my app but get the following error:

    BoamManagedObject.java:412:
    addProxyObserver(se.company.subsys.app.boam.fpx.proxies.ProxyObserver)
    in se.company.subsys.app.boam.fpx.proxies.BoamProxy cannot be applied to
    (se.company.subsys.app.boam.mao.bcm.BoamManagedObject)
    [javac] myProxies.addProxyObserver(this);


    Any hints about what this problem could be related to?

    Regards,

    //Mikael
     
    Petterson Mikael, Oct 8, 2003
    #1
    1. Advertising

  2. On Wed, 08 Oct 2003 09:11:03 +0200, Petterson Mikael wrote:
    > Hi,
    >
    > I am trying to compile my app but get the following error:
    >
    > BoamManagedObject.java:412:
    > addProxyObserver(se.company.subsys.app.boam.fpx.proxies.ProxyObserver)
    > in se.company.subsys.app.boam.fpx.proxies.BoamProxy cannot be applied to
    > (se.company.subsys.app.boam.mao.bcm.BoamManagedObject)
    > [javac] myProxies.addProxyObserver(this);
    >
    >
    > Any hints about what this problem could be related to?


    The error message tells you exactly what the problem is.

    You attempt to invoke BoamProxy.addProxyObserver(this) from within
    your BoamManagedObject class, but you need to pass a ProxyObserver to
    the method. It is apparent that BoamManagedObject isn't a
    ProxyObserver.

    If ProxyObserver is an interface, BoamManagedObject needs to implement
    it. If it's a class, BoamManagedObject needs to extend it. Or maybe
    you've simply used the wrong argument.

    /gordon

    --
    [ do not email me copies of your followups ]
    g o r d o n + n e w s @ b a l d e r 1 3 . s e
     
    Gordon Beaton, Oct 8, 2003
    #2
    1. Advertising

  3. Petterson Mikael

    Paul Lutus Guest

    Petterson Mikael wrote:

    > Hi,
    >
    > I am trying to compile my app but get the following error:
    >
    > BoamManagedObject.java:412:
    > addProxyObserver(se.company.subsys.app.boam.fpx.proxies.ProxyObserver)
    > in se.company.subsys.app.boam.fpx.proxies.BoamProxy cannot be applied to
    > (se.company.subsys.app.boam.mao.bcm.BoamManagedObject)
    > [javac] myProxies.addProxyObserver(this);
    >
    >
    > Any hints about what this problem could be related to?


    I know exactly what this error message is related to -- it is related to
    your code, which you did not post. And don't post all of it, just the
    relevant few lines that created this error message.

    Then someone here will point out your error, instead of guessing about it.

    --
    Paul Lutus
    http://www.arachnoid.com
     
    Paul Lutus, Oct 8, 2003
    #3
  4. Petterson Mikael

    Neal Gafter Guest

    Re: Help with compiler error: method in class X cannot be appliedto class Y

    Yes, the type se.company.subsys.app.boam.mao.bcm.BoamManagedObject is not a
    subtype of se.company.subsys.app.boam.fpx.proxies.ProxyObserver.

    Petterson Mikael wrote:
    > Hi,
    >
    > I am trying to compile my app but get the following error:
    >
    > BoamManagedObject.java:412:
    > addProxyObserver(se.company.subsys.app.boam.fpx.proxies.ProxyObserver)
    > in se.company.subsys.app.boam.fpx.proxies.BoamProxy cannot be applied to
    > (se.company.subsys.app.boam.mao.bcm.BoamManagedObject)
    > [javac] myProxies.addProxyObserver(this);
    >
    >
    > Any hints about what this problem could be related to?
    >
    > Regards,
    >
    > //Mikael
     
    Neal Gafter, Oct 8, 2003
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jan Danielsson
    Replies:
    2
    Views:
    10,364
    Jan Danielsson
    Jan 15, 2005
  2. Darren
    Replies:
    11
    Views:
    4,540
    Darren
    Oct 27, 2005
  3. Gavin
    Replies:
    3
    Views:
    483
    Chris Uppal
    Mar 28, 2007
  4. miller587
    Replies:
    0
    Views:
    406
    miller587
    Oct 5, 2007
  5. Replies:
    0
    Views:
    367
Loading...

Share This Page