DayOfWeek plus(long days) example
Description
DayOfWeek plus(long days)
returns
the day-of-week that is the specified number of days after this one.
Syntax
plus
has the following syntax.
public DayOfWeek plus(long days)
Example
The following example shows how to use plus
.
import java.time.DayOfWeek;
import java.time.LocalDate;
import java.time.Month;
/*from w w w . jav a 2 s .co m*/
public class Main {
public static void main(String[] args) {
LocalDate localDate = LocalDate.of(2014, Month.JUNE, 21);
DayOfWeek dayOfWeek = DayOfWeek.from(localDate);
System.out.println(dayOfWeek.getValue());
dayOfWeek = dayOfWeek.plus(2);
System.out.println(dayOfWeek.getValue());
}
}
The code above generates the following result.