Guest User

Untitled

a guest
Jun 25th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.51 KB | None | 0 0
  1. public Kortti suurinKortti() {
  2.        
  3.         Kortti suurin = null;
  4.        
  5.         for(Kortti k : kortit)
  6.         {
  7.             if(suurin == null)
  8.                 suurin = k;
  9.             else
  10.             {
  11.                 if(k.getArvo() > suurin.getArvo())
  12.                     suurin = k;
  13.                 else if(k.getArvo() == suurin.getArvo())
  14.                     if(k.getMaa() > suurin.getMaa())
  15.                         suurin = k;
  16.             }
  17.         }
  18.        
  19.         return suurin;      
  20.     }
Add Comment
Please, Sign In to add comment