Data Type Java Tutorial

The answer to this question is to use java.util.Calendar.SUNDAY, java.util.Calendar.MONDAY, and so on:

import java.text.ParseException;
public class MainClass {
  public static void main(String[] args) throws ParseException {
    java.util.Date today = new java.util.Date();
    java.sql.Date date = new java.sql.Date(today.getTime());
    java.util.GregorianCalendar cal = new java.util.GregorianCalendar();
    cal.setTime(date);
    System.out.println(cal.get(java.util.Calendar.DAY_OF_WEEK));
  }
}