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.
Scanner in = new Scanner(System.in);
int month = in.nextInt() - 1;
int day = in.nextInt();
int year = in.nextInt();
Date date = (new GregorianCalendar(year, month, day)).getTime();
SimpleDateFormat f = new SimpleDateFormat("EEEE");
String day2 = f.format(date);
System.out.println(day2.toUpperCase());
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Java Date and Time
You are viewing a single comment's thread. Return to all comments →
Scanner in = new Scanner(System.in); int month = in.nextInt() - 1; int day = in.nextInt(); int year = in.nextInt();