Java program to print weekdays using a switch statement

Java program to print weekdays using a switch statement. This Java software can assist you in determining the weekdays order. The user is prompted to input a valid week number in the program below. Check the week number using the switch case after collecting the value from the user program and display the relevant day. I assumed, like the previous program, that Monday is the beginning day of the week.

import java.util.Scanner;
public class Main
{
public static void main(String[] args)
{
Scanner scanner = new Scanner(System.in);
System.out.println("Enter the week days");
int weekday = scanner.nextInt();
if(weekday == 1)
{
System.out.println("Monday");
} else if(weekday == 2)
{
System.out.println("Tuesday");
} else if(weekday == 3) {
System.out.println("Wednesday");
} else if(weekday == 4) {
System.out.println("Thursday");
} else if(weekday == 5) {
System.out.println("Friday");
} else if(weekday == 6) {
System.out.println("Saturday");
} else if(weekday == 7) {
System.out.println("Sunday");
} else {
System.out.println("Enter the numbers between 1 to 7");
}
}
}

Enter the week days
4
Thursday