Here we go. AGAIN. Codegym just introduces a function i have NO IDEA how to use, and it wasn't even shown in the TASK ITSELF! All it gave me was a description of the syntax. WHy.
package en.codegym.task.pro.task16.task1608;
import java.time.LocalDate;
import java.time.format.TextStyle;
import java.util.Locale;
/*
Just a day of the week
*/
public class Solution {
static LocalDate birthDate = LocalDate.of(2020, 3, 12);
public static void main(String[] args) {
System.out.println(getDayOfWeek(birthDate));
}
static String getDayOfWeek(LocalDate date) {
return String.valueOf(date.getDayOfWeek());
}
}
date.getDayOfWeek();
This returns a DayOfWeek object -> Save the result in such an object. On this DayOfWeek object you're asked now to invoke the getDisplayName method with the given parameters. This method returns a String. Just return that as your result. getDayOfWeek getDisplayName The why however is beyond my knowledge :)