0
[SOLVED] Unsafe or unchecked Operation in line 57
Can someone explain why I get this compiler warning (at line 57) . And how to prevent this. The output at this point is as expected. https://code.sololearn.com/cbL2ZJT3dBA7/?ref=app
2 Réponses
+ 3
When you declare
private TreeMap<Integer,SortedSet>
visited_fields;
Don't forget to put in SortedSet's generic type in there as well
Fix:
private TreeMap<Integer,SortedSet<Integer>>
visited_fields;
Or you could just put
@SuppressWarnings("unchecked")
Over the move method just to ignore it, but it's not a fix.
0
Odyel
Thank you. That works. Very nice 👍