src/Recipe.java
/**
     * Validates the user's input by attempting to parse it as an integer.
     * - Returns the result of processing (true/false).
     */
Validates the user's input by attempting to parse it as an integer.
- Returns the result of processing (true/false).
Validates the user ' s input by attempting to parse it as an integer . - Returns the result of processing ( true / false ) .
public static boolean validateInput(String input) {
        try {
            Integer.parseInt(input);
        } catch (NumberFormatException e) {
        	/* Catches the exception if necessary (NumberFormatException)*/
            return false;
        }
        if (Integer.valueOf(input) > 0) {
        	return true;
        } else {
        	return false;
        }
    }
public static boolean validateInput ( String input ) { try { Integer . parseInt ( input ) ; } catch ( NumberFormatException e ) { /* Catches the exception if necessary (NumberFormatException)*/ return false ; } if ( Integer . valueOf ( input ) > 0 ) { return true ; } else { return false ; } }
Validates the user's input by attempting to parse it as an integer.
Validates the user ' s input by attempting to parse it as an integer .