Java guides
Every published Java guide, newest first, with practical examples you can copy into your own project.
3,965 guides across 14 topics
Topics
Popular Java guides
Most readLatest Java guides
Page 26 of 109Using java math pow Effectively
java math pow: Understand Math.pow in Java: syntax, floating-point precision, performance tradeoffs, and safer alternatives for integer exponentiation.
Using Java Math.max and Math.min
Learn how to use Java's Math.max and Math.min methods to compare primitive values, handle NaN and signed zero, and find extremes in arrays and streams.
Java Math.abs: Syntax, Edge Cases, and Overflow
Learn how to use Java's Math.abs for int, long, float, and double, including integer overflow, NaN and signed zero handling, and safer alternatives like Math.absExact.
Java Math Class: Core Methods and Practical Usage
java math class: Learn how to use the Java Math class for arithmetic, rounding, trigonometry, and random numbers, with performance and edge-case guidance.
Java Instant vs LocalDateTime: Choosing the Right Time Type
Understand the difference between java.time.Instant and LocalDateTime, when to use each, and how to convert between them safely.
Working with ZonedDateTime and Timezones in Java
java zoneddatetime timezone: Learn how to use ZonedDateTime for timezone-aware date-time handling in Java, including conversions, DST transitions, and common pitfalls.
Java ZoneId: Working with Time Zones and Offsets
Learn how to use Java ZoneId to work with time zones, offsets, and daylight saving transitions in your applications, with code examples for common conversions.
Java Duration Between: Calculating Elapsed Time
Learn how to use Java Duration.between to measure elapsed time between LocalDateTime, LocalTime, Instant, and ZonedDateTime, including time zone behavior, DST transitions, and common pitfalls.
Java Period Between Two Dates
How to use Java's Period.between to compute the calendar difference between two LocalDate values as years, months, and days, with examples and edge cases.
Java Date Comparison: Legacy vs java.time
Learn how to compare dates in Java using java.util.Date and java.time, including LocalDate, ZonedDateTime, and Instant, with practical examples.