Today we have a Java stream foreach example, a Java stream foreach lambda function example which is an example of a terminal operation and Java stream sorted which is an example of an intermediate operation. We show you how intermediate operations are used i conjunction with terminating operations. Do you understand the difference? If not, this Java Stream Tutorial is for you.