Skip to content

Commit 4434e23

Browse files
authored
Update JavaCustomTemporalAdjustersEx2.java
1 parent 6355084 commit 4434e23

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

datetime/JavaCustomTemporalAdjustersEx2.java

+5-4
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,20 @@ class NextChristmas implements TemporalAdjuster {
1010
@Override
1111
public Temporal adjustInto(Temporal temporal) {
1212

13-
return temporal.with(ChronoField.MONTH_OF_YEAR, 12).with(ChronoField.DAY_OF_MONTH, 25);
13+
return temporal.with(ChronoField.MONTH_OF_YEAR, 12)
14+
.with(ChronoField.DAY_OF_MONTH, 25);
1415

1516
}
1617
}
1718

18-
public class JavaCustomTemporalAdjustersEx2 {
19+
public class JavaCustomTemporalAdjusterEx2 {
1920

2021
public static void main(String[] args) {
2122

2223
var now = LocalDate.now();
2324
System.out.println("Today: " + now);
2425

25-
var date2 = now.with(new NextChristmas());
26-
System.out.println("Next XMas: " + date2);
26+
var xmas = now.with(new NextChristmas());
27+
System.out.println("Next XMas: " + xmas);
2728
}
2829
}

0 commit comments

Comments
 (0)