You are viewing a single comment's thread. Return to all comments →
In order to use this solution you need to import
java.time.LocalDate
which is not allowed to import a library in this challenge.
Here is my solution. Please be aware of starting index number for months starting from zero. Good luck everyone!
DateFormatSymbols dfs = new DateFormatSymbols(Locale.US); String weekdays[] = dfs.getWeekdays(); Calendar cal = new GregorianCalendar(Locale.US); cal.set(Integer.parseInt(year), Integer.parseInt(month)-1, Integer.parseInt(day)); System.out.println(weekdays[cal.get(Calendar.DAY_OF_WEEK)].toUpperCase());
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 →
In order to use this solution you need to import
which is not allowed to import a library in this challenge.
Here is my solution. Please be aware of starting index number for months starting from zero. Good luck everyone!