Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public Kortti suurinKortti() {
- Kortti suurin = null;
- for(Kortti k : kortit)
- {
- if(suurin == null)
- suurin = k;
- else
- {
- if(k.getArvo() > suurin.getArvo())
- suurin = k;
- else if(k.getArvo() == suurin.getArvo())
- if(k.getMaa() > suurin.getMaa())
- suurin = k;
- }
- }
- return suurin;
- }
Add Comment
Please, Sign In to add comment