Created
July 5, 2017 09:34
-
-
Save svenliebig/8056da5d4dc9408ec30d02aa12455845 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Quadrat() { | |
int x; | |
int y; | |
Quardrat() { | |
x = 2; | |
y = 5; | |
} | |
// pseudocode (das möchte ich machen) | |
getSumOfY(~list~) { | |
int sumOfY = 0; | |
foreach quadrat in list { | |
sumOfY += quadrat.getY() | |
} | |
return sumOfY; | |
} | |
// pseudocode ende | |
} | |
List<Quadrat> qList = new ArrayList<Quadrat>(); | |
// hinzufügen von 3 Quadrat Objekten zu der Liste | |
qList.getSumOfY() // 15 | |
qList.getSumOfX() // 6 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment