Java Collectors Example

Java Collectors Class – 18 Examples

Java Collectors is a utility class that provides many useful implementations of the Collector interface. The Collector implementation is used with the Stream collect() method. This class was introduced in Java 8 along with Stream….

Java Method Reference

Java Method Reference Types and Examples

Java Method Reference was introduced in Java 8, along with lambda expressions. The method reference is a shortcut way to create lambda expressions when it just calls a method. What is Java Method Reference? The….

Java Stream Collect

Java Stream collect() Method Examples

Java Stream collect() performs a mutable reduction operation on the elements of the stream. This is a terminal operation. What is Mutable Reduction Operation? A mutable reduction operation process the stream elements and then accumulate….

Java Array Contains

How to Check if Java Array Contains a Value?

How to Check if Java Array Contains a Value? There are many ways to check if a Java array contains a specific value. Simple iteration using for loop List contains() method Stream anyMatch() method Arrays….

Overriding vs Overloading in Java

Overriding and Overloading are the core concepts in Java programming. They are the ways to implement polymorphism in our java programs. Polymorphism is one of the OOPS Concepts. 1. What is Overloading and Overriding? When….

Matrix Programs in Java

A Matrix is a rectangular array. The elements are arranged in the rows and columns. In this tutorial, we will look at some matrix programs in Java. Graphical Representation of Matrix Matrix in Java We….

Command Line Arguments in Java

Command-line arguments in Java are used to pass arguments to the main program. If you look at the Java main method syntax, it accepts String array as an argument. When we pass command-line arguments, they….

Finding and Checking Prime Numbers in Java

What is a Prime Number? A prime number is a natural number greater than 1 that is only divided by 1 and itself. For example, 5 is a prime number because it can be divided….

Gangs of Four (GoF) Design Patterns

Gangs of Four Design Patterns is the collection of 23 design patterns from the book “Design Patterns: Elements of Reusable Object-Oriented Software”. This book was first published in 1994 and it’s one of the most….

Relational Operators in Java

Relational Operators in Java are used to comparing two variables for equality, non-equality, greater than, less than, etc. Java relational operator always returns a boolean value – true or false. Relational Operators in Java Java….

Generic selectors
Exact matches only
Search in title
Search in content
Search in posts
Search in pages