Skip to content

Instantly share code, notes, and snippets.

@JoshuaFox
Created August 14, 2022 18:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JoshuaFox/291edc84e650358caa76e6cdd97f38aa to your computer and use it in GitHub Desktop.
Save JoshuaFox/291edc84e650358caa76e6cdd97f38aa to your computer and use it in GitHub Desktop.
Java loop
public static List<Integer> main() {
List<Integer> result = new ArrayList<>();
for (int i = 0; i < 4; i++) {
result.add(i * i);
}
return result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment