Get the weekday of a date in Java

Main.java:

import java.util.*;
 
public class Main
{
   public static void main(String []args) {
      String[] days = { "", "Sunday", "Monday", "Tuesday", 
                        "Wednesday", "Thursday", "Friday", "Saturday" };
 
      Calendar cal = Calendar.getInstance();
      cal.setTime(new Date());
      int dayOfWeek  = cal.get(Calendar.DAY_OF_WEEK);
      System.out.println(days[dayOfWeek]);
   }
}