Results 1 to 2 of 2
  1. #1
    AliceNewbie is offline Member
    Join Date
    Feb 2010
    Posts
    1
    Rep Power
    0

    Unhappy Can not find symbol ???

    When I try to compile the following I get "Can not find symbol" 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());

    }
    }

    I used Netbeans and the latest version of JAVA JDK. :(:confused:

    PLEASE HEEEEELP :eek:

  2. #2
    collin389 is offline Senior Member
    Join Date
    Nov 2009
    Posts
    235
    Rep Power
    6

Similar Threads

  1. cannot find symbol
    By GabWit in forum New To Java
    Replies: 3
    Last Post: 01-25-2009, 01:13 AM
  2. java:34:cannot find symbol
    By MissyMadi in forum New To Java
    Replies: 5
    Last Post: 11-09-2008, 07:53 PM
  3. Replies: 9
    Last Post: 10-18-2008, 09:26 PM
  4. 'Cannot find symbol' error
    By minihazard10 in forum New To Java
    Replies: 6
    Last Post: 10-10-2008, 05:05 AM
  5. Replies: 3
    Last Post: 05-01-2008, 09:30 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •