PDA

Click to See Complete Forum and Search --> : Warning message


Grhymn
Mar 18th, 2010, 02:48 PM
Hi,
I am quite new to java and got following warning message after compiling:
Note:...\Player.java uses unchecked or unsave operations.
Note:Recompile with -Xlint: unchecked for details.

I got the message after adding following method:
public boolean controleOverlappend(ArrayList<Position> coordinaten)
{
boolean value=false;
Set coordinatenSet=map.keySet();
Iterator<Position> it=coordinatenSet.iterator();
Iterator<Position> it2=coordinaten.iterator();
while (it2.hasNext()){

while(it.hasNext()){
value= !it2.next().equals(it.next());

}
}
return value;

}

Grhymn
Mar 18th, 2010, 02:50 PM
Can anyone tell me what's wrong, or is this too few information?

kfcSmitty
Mar 18th, 2010, 07:05 PM
Java 1.5 implemented a new feature: Generics.

For more information on it check out: http://java.sun.com/j2se/1.5.0/docs/guide/language/generics.html

ComputerJy
Mar 19th, 2010, 12:37 PM
Instead of using the plain Set class, you need to use the generic Set<T> where T is Key class of your Map m

Grhymn
Mar 21st, 2010, 06:30 AM
Ok, thank you!