Jump to content

Day of the week: Difference between revisions

Line 1,047:
<lang scala>
import java.util.{Calendar, GregorianCalendar}
import Calendar._
 
object DayOfTheWeek {
Line 1,052 ⟶ 1,053:
def main(args:Array[String]) {
for (year <- 2008 to 2121;
date <- Some(new GregorianCalendar(year, Calendar.DECEMBER, 25));
if date.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY) {
println(year)
}
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.