Anyone have a clue whats going on here i keep getting unchecked or unsafe operations. Tried compiling it in command window. Still dont know what the problem is. Thanks.
Well, we're missing the code to Move.java but generally casts are not a good idea since the inclusion of generics in the language. You're likely to get better results by doing:
<a href="http://forums.hotjoe.com/forums/list.page" target="_blank" rel="nofollow">Java forums using Java software</a> - Come and help get them started.
The problem you're having is that things like ArrayList and the other collections always took and returned Object's in 1.4 and below. Now you can strongly type them by specifing that, for example, zplain is an ArrayList of Move objects. Nothing else will be allowed to be put in or returned from the ArrayList. The error and warnings are to let you know that there is a safer way of doing things in Java 1.5/5.0.
<a href="http://forums.hotjoe.com/forums/list.page" target="_blank" rel="nofollow">Java forums using Java software</a> - Come and help get them started.
Your original code will compile without warning using -source 1.4 (and therefore, -target 1.4). Therefore, the question is "which VM are you targetting?" If you are targetting 1.5, you will need to become familiar with 1.5 language features, and in this specific case generics.
If you are not targetting 1.5 - but some lower VM (e.g. 1.4) - then you can delay learning these new language features for now.
Simply, if you are using/targetting 1.5, you need to know what 1.5 is.
Originally posted by Tony Morris: Your original code will compile by warning using -source 1.4 (and therefore, -target 1.4). Therefore, the question is "which VM are you targetting?" If you are targetting 1.5, you will need to become familiar with 1.5 language features, and in this specific case generics.
If you are not targetting 1.5 - but some lower VM (e.g. 1.4) - then you can delay learning these new language features for now.
Simply, if you are using/targetting 1.5, you need to know what 1.5 is.