What will be printed into the console?
val Constant = 'Q'
def tokenMe(ch: Char) = (ch: @switch) match {
  case ' ' | '\t' | '\n'  => 1
  case 'A' | 'Z' | '$'    => 2
  case '5' | Constant     => 3 
  case _                  => 4
}
println(tokenMe('5'))

Topic Statistics

25%

  • 75Right (%)
  • 25Wrong (%)
to get statistics

Follow Quizful

Send Feedback
or join Alpha test group