Java Branching Statements

Now that you understand the while and do-while statements from lesson 8.4, let’s move onto the next lesson on the Java Branching Statement. The break, continue, and return statements comprise the branching statements in the Java programming language. Break

Java For Statement

The for statement in Java provides a compact way to iterate or loop over a range of values. Java Programmers often refer to it as the “for loop” due to the way in which it repeatedly loops until a

Java Switch Statement

Now that you understand the if-then and if-then-else from lesson 8.1, let’s move onto the next lesson on the Java Switch Statement. Unlike the if-then and if-then-else statements, the switch statement can have a multiple execution paths. A switch

Java 8 Stream collect Sample

Java 8 Streams collect method performs a mutable reduction operation on the stream elements. Stream elements are included into the result by updating rather than by replacing. The Java 8 Stream collect() method is a terminal operation. After the

Java 8 Stream map Sample

Java 8 Streams map method returns a stream base on the results of applying the given function to the elements in this stream. We can use function for transforming the objects based on the input method. The sample

Java 8 Stream forEach Sample

Java 8 Streams forEach method is simplest and most widely used operation. The forEach() method will loop over the stream elements and call the supplied function on each element. The Stream.forEach() method works like the standard for loop. It

Java 8 Stream Operations

Java 8 Streams API supports parallel operations to process your data, while completely abstracting out the low level multi-threading logic. This logic allows the developer to fully concentrate on the data and the operations to be performed on the

If Then & If Then Else

If Then Statement The Java if-then statement is the most commonly used of all the control flow statements. The if-then statement controls the flow of your Java program by deciding whether or not to execute a section of code