3:06 pm - Saturday September 26, 3198

Calendar in java example program setFirstDayOfWeek(int value)

CANDID INDUSTRIAL TRAINING -- CHENNAI
Corporate Training for Experienced Candidate
Struts | Hibernate | Spring | Java / J2EE
SOAP | RestFull | Design Pattern | more...
Ph: +91 72000 69003
137b, 2nd st, shanthi nagar, Chrompet, Chennai -600044

/**

*@author:candidjava.com
*@description: Calender in java example program setFirstDayOfWeek(int value);

*/
import java.util.Calendar;
public class CalendarSetFirstDayOfWeek {
public static void main(String[] args) {
Calendar cal = Calendar.getInstance(); // create a calendar
int day = cal.getFirstDayOfWeek();
System.out.println("Current first day of the week:" + day); // print current first day of the week
cal.setFirstDayOfWeek(Calendar.WEDNESDAY); // set first day of the week as something else
day = cal.getFirstDayOfWeek();
System.out.println("Altered first day of the week:" + day); // printing altered first day of the week
}
}

//OUTPUT:

Current first day of the week:1
Altered first day of the week:4

BACK

Filed in: Z-A All Java Codes

Comments are closed.