mart_man00
08-24-2004, 03:55 PM
Im trying to get a linked list created, and then check out every object in it.
Heres what im dealing with
public static void main(String[] args) {
card current = new card(0,0);
int x = 1;
List hand = new LinkedList();
while(x < 10) {
hand.add(new card(x,x));
++x;
}
while(x > 0) {
current = hand.get(x);
--x;
}
}
and i get back
Main.java [30:1] incompatible types
found : java.lang.Object
required: card
current = hand.get(x);
^
1 error
Errors compiling Main.
Thanks
Heres what im dealing with
public static void main(String[] args) {
card current = new card(0,0);
int x = 1;
List hand = new LinkedList();
while(x < 10) {
hand.add(new card(x,x));
++x;
}
while(x > 0) {
current = hand.get(x);
--x;
}
}
and i get back
Main.java [30:1] incompatible types
found : java.lang.Object
required: card
current = hand.get(x);
^
1 error
Errors compiling Main.
Thanks