Skip to content

Instantly share code, notes, and snippets.

@up1
Last active July 3, 2026 06:52
Show Gist options
  • Select an option

  • Save up1/5d6bb0b8710c3c6a9c00b8dd8b7b5b95 to your computer and use it in GitHub Desktop.

Select an option

Save up1/5d6bb0b8710c3c6a9c00b8dd8b7b5b95 to your computer and use it in GitHub Desktop.
Hello Java
import static java.lang.IO.print;
import static java.lang.IO.println;
void main() {
int[] arr = {1, 2, 3, 4, 5};
// For each
for (int i : arr) {
print(i + " ");
}
println();
// Stream API
Arrays.stream(arr).forEach(i -> print(i + " "));
println();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment