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….

Java List removeAll(Collection) Examples

Java List removeAll() method removes all of its elements that are also present in the given list. The method throws UnsupportedOperationException if the operation is not supported by the list. If the given collection is….

Java List remove() Methods – ArrayList remove()

Java List remove() method is used to remove elements from the list. ArrayList is the most widely used implementation of the List interface, so the examples here will use ArrayList remove() methods. Java List remove()….

Java Stream distinct() Function to Remove Duplicates

Java Stream distinct() method returns a new stream of distinct elements. It’s useful in removing duplicate elements from the collection before processing them. Java Stream distinct() Method The elements are compared using the equals() method…..

Java Stream forEach() and forEachOrdered() Methods

Java Stream forEach() and forEachOrdered() are terminal operations. The forEach() method is used to perform an action on each elements of the stream. If the forEach() method is used with parallel stream, the encounter order….

Java Modulo Operator – Modulus Operator in Java

Java Modulo operator or modulus operator is used to getting the remainder when we divide an integer with another integer. Java Modulo Operator Syntax The % character is the modulus operator in Java. Its syntax….

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