I'm new to Kotlin and while doing a course there was a bit where you worked with the current weekday.
The course used this java code to get it:
import java.util.*
Calendar.getInstance().get(Calendar.DAY_OF_WEEK)
but I don't understand why
Calendar.DAY_OF_WEEK wouldn't work either, or whats the difference between the two.
Thanks for the explanation
Calendar.DAY_OF_WEEK is simply a constant to tell the Calendar API which info you'd like to request: https://docs.oracle.com/javase/7/docs/api/java/util/Calendar.html#DAY_OF_WEEK
Calendar.getInstance() gives you a Calendar instance. This takes things like the current timezone and local time into account. The get() method allows you to get information using the constants above. https://docs.oracle.com/javase/7/docs/api/java/util/Calendar.html#get(int)