I am tryuibg to compile the following using Netbeans.
The compilation gives me 2 errors (actually the same error twice) :public class Example1 { public int sumOfDigits(int n) { int sum = 0; n = Math.abs(n); while (n > 0) { sum += n % 10; n /= 10; } return sum; } public void inputAndProcess(Input in) { System.out.print("Type an integer: "); int n = in.nextInt(); System.out.print("The sum of the digits of: " + n); System.out.println(" is: " + sumOfDigits(n)); } // The main method should do no more than create the object // and call a method to do the work. public static void main(String[] args) { new Example1().inputAndProcess(new Input()); } }
Can NOT find Symbol class Input location class Example1
I am using the latest Java JDK. What should I do? Please help.