Create a method to throw an exception if does not print a string
public static void printNum (int number) throws Exception { if (number < 0) { throw new Exception("Number can't be less than zero"); } else { System.out.println("Number is " + number); } }