76.6k views
3 votes
Write a program that displays Welcome to Java five times.

User Mfit
by
4.3k points

1 Answer

7 votes

Answer:

public static void main(String[] args) {

IntStream.range(1, 5).forEach(i -> {

System.out.println("Welcome to Java");

});

}

Step-by-step explanation:

User Shmuli
by
4.1k points