Jump to content

Unchecked Warnings

- - - - -

  • Please log in to reply
2 replies to this topic

#1
Shaddix

Shaddix

    Programmer

  • Members
  • PipPipPipPip
  • 102 posts
this is a bit of a noob-question, but I never got into the topic of this kind of warnings

why does the line where I sort the arraylist result in an "Unchecked Warning" ? And what would be the best practice to not have these warnings?

public Boolean isYahtzee(ArrayList<Dice> dices){
		Collections.sort(dices);
		if(dices.get(0).getValue() == dices.get(4).getValue()){
			return true;
		}else{
			return false;
		}		
	}


#2
wim DC

wim DC

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,084 posts
  • Programming Language:Java, JavaScript, PL/SQL
  • Learning:Java
Did the Dice class implements Comparable<Dice> instead of just implements Comparable ?

#3
Shaddix

Shaddix

    Programmer

  • Members
  • PipPipPipPip
  • 102 posts
that was the problem, thanx ;)




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users