progs/lecture3.scala
changeset 178 fdf77ee57cdc
parent 170 37b1bfcdba79
child 194 060b081523de
equal deleted inserted replaced
177:7d3037a57125 178:fdf77ee57cdc
   118 fav_colour(Green)
   118 fav_colour(Green)
   119 
   119 
   120 
   120 
   121 // actually colors can be written with "object",
   121 // actually colors can be written with "object",
   122 // because they do not take any arguments
   122 // because they do not take any arguments
       
   123 
       
   124 abstract class Day
       
   125 case object Monday extends Day 
       
   126 case object Tuesday extends Day 
       
   127 case object Wednesday extends Day
       
   128 case object Thursday extends Day 
       
   129 case object Friday extends Day 
       
   130 case object Saturday extends Day
       
   131 case object Sunday extends Day 
       
   132 
   123 
   133 
   124 
   134 
   125 // ... a bit more useful: Roman Numerals
   135 // ... a bit more useful: Roman Numerals
   126 
   136 
   127 abstract class RomanDigit 
   137 abstract class RomanDigit