OCP Exam Series VI – Streams

Introduction In this post, we will cover the streams in Java 8. We will discover the three parts of the pipeline: source, terminal, and intermediate operations. What is a stream pipeline? Stream operations are divided into intermediate and terminal operations and are combined to form stream pipelines. A stream pipeline consists of a source; followed by zero or more intermediate

Read More

OCP Exam Series V – Built-in Functional Interfaces

Introduction Functional interfaces are the basics of functional programming in Java 8. If you master the six basic interfaces, you can derive the rest and understand the streams. In this section, we will cover the common functional interfaces in java.util.function package: Supplier, Consumer, Predicate, Function, UnaryOperator, and BinaryOperator. Class Hierarchy The diagram shows the class

Read More

OCP Exam Series IV – Java Collections Framework

Introduction The collection interfaces are divided into two groups: the most basic interface java.util.Collection, and other collection interfaces based on java.util.Map. In this section, we will cover four main interfaces in the Java Collections Framework: List, Set, Map, and Queue. List You usually use a list when you want an ordered collection that can contain duplicate entries. All

Read More

OCP Exam Series III – Generics

Introduction Generics enable types (classes and interfaces) to be parameters when defining classes, interfaces, and methods. It enables you to re-use the same code. In this section, we will cover Generic Classes, Generic Interfaces, Generic Methods, and Bounded Type Parameters. Type Parameter Naming Conventions By convention, type parameter names are single, uppercase letters. The most

Read More