Last active
September 8, 2021 05:25
-
-
Save dbushenko/7de1543882b25d45906e7674f6efaaea to your computer and use it in GitHub Desktop.
This file contains 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
// mutable i | |
// | |
int i = 0; | |
while (something() > 0) { | |
i++; | |
} | |
// immutable i | |
// | |
int countWhileSomething(final int i) { | |
if (! (something() > 0) ) { | |
return i; | |
} else { | |
countWhileSomething(i + 1); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment