Here you can find the source of getDayOfWeek(int _year, int _month, int _day)
public static int getDayOfWeek(int _year, int _month, int _day)
//package com.java2s; import java.util.*; public class Main { public static int getDayOfWeek(int _year, int _month, int _day) { int year, month, date; Calendar cal = Calendar.getInstance(); cal.set(_year, _month - 1, _day); return cal.get(Calendar.DAY_OF_WEEK); }/*from w w w .j a v a 2 s .c om*/ }