Class StreamCountFindMatchExample

java.lang.Object
modernfeatures.streams.StreamCountFindMatchExample

public class StreamCountFindMatchExample extends Object
Demonstrates counting, finding, and matching operations with Java 8 Streams.

This example shows how to:

  • Count the number of names matching a condition
  • Find the first name alphabetically (in uppercase)
  • Check if all names start with an uppercase letter
  • Constructor Details

    • StreamCountFindMatchExample

      public StreamCountFindMatchExample()
  • Method Details

    • main

      public static void main(String[] args)
      Main method demonstrating the use of count, findFirst, and allMatch stream operations.
      1. Count names longer than 4 characters
      2. Find the first name in alphabetical order (uppercase)
      3. Check if all names start with uppercase letters
      Parameters:
      args - Command-line arguments (not used)