import java.io.FileReader
import java.io.FileNotFoundException
import java.io.IOException
object Demo {
def main(args: Array[String]): Unit = {
try {
val f = new FileReader("test.txt")
} catch {
case ex: FileNotFoundException => {
println("FileNotFoundException")
}
case ex: IOException => {
println("IOException")
}
} finally {
println("finally")
}
}
}
/*
run:
FileNotFoundException
finally
*/