Day 16: Exceptions - String to Integer

  • + 0 comments
            try{
                Integer.parseInt(S);
                System.out.println(S);
            } catch(NumberFormatException e){
                System.out.println("Bad String");
            }