Informatiker Board (http://www.informatikerboard.de/board/index.php)
- Themengebiete (http://www.informatikerboard.de/board/board.php?boardid=1)
-- Theoretische Informatik (http://www.informatikerboard.de/board/board.php?boardid=5)
--- LinkedList als Parameter?? (http://www.informatikerboard.de/board/thread.php?threadid=250)
Zitat: |
public class Klasse1{ public int anzahlGeradeZahlen(LinkedList<Integer>myList(), boolean zahlenArt){ int gerade=0; int ungerade=0; for(int i=0;i<myList.size();i++){ if(myList.get(i)%2 ==0){ gerade++; }else{ ungerade++; } } if (zahlenArt == true){ return gerade; }else{ return ungerade; } } } |