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. println(x.match{
  12. case _: Exception1 => "1"
  13. case _: Exception2 => "2"
  14. case _: Exception3 => "3"
  15. case _ => "Unknown"
  16. })
  17. }
  18. }
  19. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
1
2
10
42
11
compilation info
Main.scala:11: error: '}' expected but ';' found.
      println(x.match{
^
Main.scala:11: error: identifier expected but 'match' found.
      println(x.match{
                ^
Main.scala:19: error: eof expected but '}' found.
}
^
three 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