comparison chapter7/trycatchfinally.scala @ 0:b316eec6fa7a draft default tip

add sample files
author Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
date Tue, 08 Jan 2013 16:41:46 +0900
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:b316eec6fa7a
1 import java.net.URL
2 import java.net.MalformedURLException
3
4 def urlFor(path: String) =
5 try {
6 new URL(path)
7 } catch {
8 case e: MalformedURLException = >
9 new URL("http://www.scala-lang.org")
10 }