In this case , no. of objects eligible for gc could be 0 or 1 depending upon whether exception occurs at line 7 or not.
If you pass num say "Swapnil", then there will be one object eligible for garbage collection which is NumberFormatException object.
But if you pass num say "1", some
String which you can parse then number of object eligible for gc will be zero because there will be no exception in that case.
Regards
Naseem