fork download
  1. class Exception1 extends Exception
  2. class Exception2 extends Exception
  3. class Exception3 extends Exception
  4.  
  5. object Main {
  6. def main(args: Array[String]) {
  7. try {
  8. // jakiś kod
  9. } catch { x =>
  10. println("Exception")
  11. val msg = x match {
  12. case _: Exception1 => "1"
  13. case _: Exception2 => "2"
  14. case _: Exception3 => "3"
  15. case _ => "Unknown"
  16. }
  17. println(msg)
  18. }
  19. }
  20. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
1
2
10
42
11
compilation info
Main.scala:11: error: '}' expected but ';' found.
      val msg = x match {
^
Main.scala:20: error: eof expected but '}' found.
}
^
two errors found
spoj: The program compiled successfully, but Main.class was not found.
      Class Main should contain method: def main(args: Array[String]).
stdout
Standard output is empty