1fun main(args: Array<String>) {
2 for (str in args) {
3 try {
4 val parsedInt = str.toInt()
5 println("The parsed int is $parsedInt")
6 } catch (nfe: NumberFormatException) {
7 // not a valid int
8 }
9 }
10}
11