object Weekdays extends Enumeration { type WEEKDAY = Value val MON, TUE, WED = Value } object MyMain { def isMonday(w:Weekdays.Value) = { w == Weekdays.MON } def main(args:Array[String]) = { val w = Weekdays.MON val w2 = Weekdays.WED println(isMonday(w)) println(isMonday(w2)) } }
0 件のコメント:
コメントを投稿