Java Calendar.DAY_OF_WEEK gives wrong day
问题 What is wrong with the below code? It gives wrong day for any date of the year. import java.util.Scanner; import java.util.Calendar; public class Solution { public static String getDay(String d, String m, String y) { String[] days = {"SUNDAY", "MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY", "SATURDAY"}; Calendar c = Calendar.getInstance(); c.set(Integer.parseInt(y), Integer.parseInt(m), Integer.parseInt(d)); return days[c.get(Calendar.DAY_OF_WEEK) - 1]; } public static void main