Sum of digits in an integer..(JAVA) Sum of digits in an integer using recursion: Write a recursive method that computes the sum of the integer. Use the following method header: Public static int sum Digits(long n) Write a test program that prompt the user to enter an integer and displays its sum. Your program need to include the try and catch block to handle bad input and request use to If the input is appropriate, your display should be similar to the following: If your input is other than an integer, your display should be similar to the following: Solution SumofDigitsRecursive.java import java.util.Scanner; public class SumofDigitsRecursive {//public class static int sum = 0;//static variable public static void main(String a[]) { Scanner sc = new Scanner(System.in);//scanner class for keyboard inputting System.out.println(\"please enter the number\"); try{//ecception handling int number = sc.nextInt();//keyboard inputting System.out.println(\"Sum is: \" + SumofDigitsRecursive.SumDigits(number));//calling static method } catch(Exception e) { System.out.println(\"you have entered bad input please try again exception \"+e); } } public static int SumDigits(long number) { if (number == 0) { return sum; } else { sum += (number % 10); SumDigits(number / 10); } return sum; } } output please enter the number 94506 Sum is: 24 please enter the number sssfsfsf you have entered bad input please try again exception java.util.InputMismatchException .