OOP的にはこうじゃね?違うか?自信無い。

int i;
try{
 i = Integer.parseInt(a)
} catch(NumberFormatException nfe){
 i = 10;
}