Here you can find the source of dayOfWeek()
public static int dayOfWeek()
//package com.java2s; //License from project: Apache License import java.util.GregorianCalendar; public class Main { public static int dayOfWeek() { GregorianCalendar g = new GregorianCalendar(); int ret = g.get(java.util.Calendar.DAY_OF_WEEK); g = null;//from w w w. ja v a2 s . c o m return ret; } }