We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
String month = in.next();
String day = in.next();
String year = in.next();
Calendar cal = new GregorianCalendar(Integer.parseInt(year),(Integer.parseInt(month)-1),(Integer.parseInt(day)-1));
int dayOfWeek = cal.get(Calendar.DAY_OF_WEEK);
String days[]={"", "MONDAY","TUESDAY", "WEDNESDAY", "THURSDAY","FRIDAY","SATURDAY","SUNDAY"};
System.out.println(days[dayOfWeek]);
}
Java Date and Time
You are viewing a single comment's thread. Return to all comments →
Here is the Solution:
import java.io.; import java.util.; import java.text.; import java.math.; import java.time.*;
public class Solution {
}