Article
Regular Expressions (RegEx) are a powerful tool and help us match patterns in a flexible, dynamic and efficient way, as well as to perform operations based on the results. In this tutorial, we'll take a look at how to validate an phone number in Java, using Regular Expressions (RegEx). If...
David Landup
Regular Expressions (RegEx) are one of the most powerful tools in programming, yet they're also commonly misunderstood. They help you match patterns in a flexible, dynamic and efficient way, as well as allow you to perform operations based on the results. This can include validating certain patterns that exist in...
Bilal Hamada
The findFirst() and findAny() methods are terminal operations (terminate and return results) of the Stream API. Yet, there is something special about them - they not only terminate a stream, but also short circuit it: List<String> people = List.of("John", "Janette", "Maria&...
Hiram Kamau
Sorting is one of the fundamental techniques used in solving problems, especially in those related to writing and implementing efficient algorithms. Usually, sorting is paired with searching - meaning we first sort elements in the given collection, then search for something within it, as it is generally easier to search...
Branko Ilic
If you have worked with Spring Data JPA for any length of time - you're probably acquainted with derived query methods: @Repository public interface BookRepository extends MongoRepository<Book, String> { List<Book> findByAuthor(String name); } They are a nifty and quick way to offload the burden of...
The Java Streams API simplifies working with a collection of elements. Because streams turn these elements into a pipeline, you could test them using a set of conditions (known as predicates), before finally acting on those that meet your criteria. The filter() method is one such operation that tests the...
Streams don't hold any data by themselves - they just stream it from a source. Yet, common code routines expect some sort of a structure to hold results after processing data. That is why, after (optional) intermediate operations, the Stream API provides ways to convert the elements that it may...
Calculating a factorial of a number is a straightforward task. A factorial of a number is the product of that number (positive integer) and all positive integers less than that number. In other words - multiplying a number by all of the whole numbers from that number to 1. 0!...
Ruslan Hasanov
If you have worked with Spring Data JPA for any length of time - you're probably acquainted with derived query methods: public interface MyRepository extends JpaRepository<Client, Long> { List<Client> findByOrganizationName(String name); } They are a nifty and quick way to offload the burden of writing...
© 2013-2025 Stack Abuse. All rights reserved.