You are viewing a single comment's thread. Return to all comments →
import java.util.; import java.io.;
public class DayOfWeekFinder {
public static String findDay(int day, int month, int year) { Calendar calendar = Calendar.getInstance(); calendar.set(year, month - 1, day); return calendar.getDisplayName(Calendar.DAY_OF_WEEK, Calendar.LONG, Locale.getDefault()).toUpperCase(); } public static void main(String[] args) throws IOException { Scanner scanner = new Scanner(System.in); int month = scanner.nextInt(); int day = scanner.nextInt(); int year = scanner.nextInt(); scanner.close(); String dayOfWeek = findDay(day, month, year); System.out.println(dayOfWeek); }
}
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 →
import java.util.; import java.io.;
public class DayOfWeekFinder {
}