I am trying to convert String value of a weekday to a Number.
I was looking into Enum DayOfWeek
(https://docs.oracle.com/javase/8/docs/api/java/time/DayOfWeek.html), but it does not work the way I expected.
Code
String n = "MONDAY";
System.out.println(n); //prints MONDAY
System.out.println(DayOfWeek.valueOf(n)); //also prints MONDAY - should print 1
How can I get the corresponding number from my string instead?