Calendar class setFirstDayOfWeek(int value) method example
Sets what the first day of the week is; e.g., SUNDAY in the U.S., MONDAY in France.
Calendar class setFirstDayOfWeek(int value)method example. This example shows you how to use setFirstDayOfWeek(int value)method.This method Sets what the first day of the week is; e.g., SUNDAY in the U.S., MONDAY in France.
Here is the code:-
/**
* @Program that Sets what the first day of the week is; e.g.,
* SUNDAY in the U.S., MONDAY in France.
* SetFirstDayOfWeek.java
* Author:-RoseIndia Team
* Date:-23-May-2008
*/
import java.util.*;
public class SetFirstDayOfWeek {
public static void main(String[] args) {
Calendar c=Calendar.getInstance();
//Gets what the first day of the week
System.out.println("First Day of week before setting is "
+c.getFirstDayOfWeek());
//Sets the first day of the week as 2
c.setFirstDayOfWeek(2);
System.out.print("First Day of week after setting is "
+c.getFirstDayOfWeek());
}
} |
Output of the program:-
First Day of week before setting is 1
First Day of week after setting is 2 |
|