Package modernfeatures.streams
Class StreamCountFindMatchExample
java.lang.Object
modernfeatures.streams.StreamCountFindMatchExample
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 Summary
Constructors -
Method Summary
-
Constructor Details
-
StreamCountFindMatchExample
public StreamCountFindMatchExample()
-
-
Method Details
-
main
Main method demonstrating the use of count, findFirst, and allMatch stream operations.- Count names longer than 4 characters
- Find the first name in alphabetical order (uppercase)
- Check if all names start with uppercase letters
- Parameters:
args
- Command-line arguments (not used)
-