[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: My object is not compatible with java/lang/Object
From: |
Paul E Johnson |
Subject: |
Re: My object is not compatible with java/lang/Object |
Date: |
Mon, 30 Apr 2001 10:52:27 -0500 |
Nicolas Garrido wrote:
>
> Hi,
>
> Why a receive the following message?
>
> *** Error: The type of the left-hand side in this assignment, "Consumer", is
> not
> compatible with the type of the right-hand side expression,
> "java/lang/Object"
>
> This is the instruction
>
> Consumer auxCons;
> auxCons = ConsumerGrid.getObjectAtX$Y(this.xnorm(i),this.ynorm(j));
>
You need to cast the thing you get back as a Consumer. Its that way in
java generally. When you take an object out of a list, you must cast it
as its own type. Putting things into lists causes them to be seen as
just Objects, you know.
--
Paul E. Johnson email: address@hidden
Dept. of Political Science http://lark.cc.ukans.edu/~pauljohn
University of Kansas Office: (785) 864-9086
Lawrence, Kansas 66045 FAX: (785) 864-5700
==================================
Swarm-Support is for discussion of the technical details of the day
to day usage of Swarm. For list administration needs (esp.
[un]subscribing), please send a message to <address@hidden>
with "help" in the body of the message.