FIND YOUR NEXT FEW LINES
The snippet library.
Small, practical examples. Search by task or narrow things down below.
5 snippets foundClear filters
Add days to a date
Parse an ISO date and add calendar days using Java LocalDate.
Java✓ Tested
Format a decimal number
Format a Java decimal with two digits and a fixed locale.
Java✓ Tested
Parse an integer safely
Handle invalid Java integer input with NumberFormatException.
Java✓ Tested
Sum integer values
Reduce a Java integer stream to its sum.
Java✓ Tested
Use an optional fallback
Use Optional.orElse to provide a default for a missing Java value.
Java✓ Tested