#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Posts
    22
    Rep Power
    0

    Need help with my code :S.


    Hello. I am making a very simple java programm which reads a number from the user and it multiplies it with the numbers from 1 to 9. When i try to compile my programm I have 9 errors which I dont know how to fix. Here is the code.


    import java.util.Scanner;
    public Class Pol
    {
    public static void main(String[] args)
    {
    Scanner s=new Scanner(System.in);
    System.out.print("Give me a number=");

    int a=s.nextInt();

    for(int i=1; i<10; i++)
    {
    System.out.println("The" +a +"x" +i +"equals to" +(a*i));
    }
    }
    }

    Thank you in advance.
  2. #2
  3. Java Junkie
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jan 2004
    Location
    Mobile, Alabama
    Posts
    4,021
    Rep Power
    1285
    Remember Java is case-sensitive.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Posts
    47
    Rep Power
    0
    Originally Posted by Uniflame
    Hello. I am making a very simple java programm which reads a number from the user and it multiplies it with the numbers from 1 to 9. When i try to compile my programm I have 9 errors which I dont know how to fix. Here is the code.


    import java.util.Scanner;
    public Class Pol
    {
    public static void main(String[] args)
    {
    Scanner s=new Scanner(System.in);
    System.out.print("Give me a number=");

    int a=s.nextInt();

    for(int i=1; i<10; i++)
    {
    System.out.println("The" +a +"x" +i +"equals to" +(a*i));
    }
    }
    }

    Thank you in advance.
    Relook at your class declaration. There's Something very wrong ! ( For java Conventions ). Other than that, Everything's Fine.
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Posts
    22
    Rep Power
    0
    Ok found the problem. Class should have been writen class. Thank you.
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Posts
    47
    Rep Power
    0
    Originally Posted by Uniflame
    Ok found the problem. Class should have been writen class. Thank you.
    Should You Have Used ECLIPSE, you'd be instantly notified of the Bug.

IMN logo majestic logo threadwatch logo seochat tools logo