LocalTime with(TemporalAdjuster adjuster) example
Description
LocalTime with(TemporalAdjuster adjuster)
returns an adjusted copy of this time.
Syntax
with
has the following syntax.
public LocalTime with(TemporalAdjuster adjuster)
Example
The following example shows how to use with
.
import java.time.LocalTime;
/*from www . j a va 2s.com*/
public class Main {
public static void main(String[] args) {
LocalTime l = LocalTime.now();
LocalTime s = l.with(LocalTime.NOON);
System.out.println(s);
}
}
The code above generates the following result.