The problem
In this exercise you will write a program that displays the following strings to the console:
- Welcome to Java
- Welcome to Computer Science
- Programming is fun
Breaking it down
Java 8 provides a way to create a stream of strings by calling the Stream.of
while passing one to many arguments. Then calling the Stream.forEach
passing in a referencing to System.out::println
will print the stream elements.