return which day of week from date in java

return which day of week from date in java
refer ‮uttual:ot‬ri.com
/**
 * @author lautturi.com 
 * Java example: get the day of week from date in java
 */


import java.text.SimpleDateFormat;
import java.util.*;

public class Lautturi {
	public static void main(String[] args) {
		SimpleDateFormat simpleDateformat = new SimpleDateFormat("EEEE");
        int year = 2020;
        int month = 12;
        int day = 21;
        Date date = new GregorianCalendar(year, month - 1, day).getTime();
        String dayText = simpleDateformat.format(date);
    
        dayText = dayText.toUpperCase();
		System.out.println(dayText.toUpperCase());
	}
}

output:

TUESDAY
Created Time:2017-10-07 22:13:25  Author:lautturi