Using forEach:
int[] numbers = {1,2,3,4,5};Arrays.stream(numbers).forEach(System.out::println);
Response:
12345The process finished with exit code 0
PS: You need a Array (int[] numbers
), and import java.util.Arrays;
Using forEach:
int[] numbers = {1,2,3,4,5};Arrays.stream(numbers).forEach(System.out::println);
Response:
12345The process finished with exit code 0
PS: You need a Array (int[] numbers
), and import java.util.Arrays;