Java Date and Time

  • + 0 comments

    my answer by pass All testcase

    public static String findDay(int month, int day, int year) { Calendar calendar = Calendar.getInstance(); calendar.set(year, month - 1, day); int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK); System.out.println(dayOfWeek); String[] dayOf = { "SUNDAY", "MONDAY",
    "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY", "SATURDAY" }; return dayOf[dayOfWeek - 1]; } }