Results 1 to 5 of 5
  1. #1
    BillyB is offline Member
    Join Date
    Nov 2010
    Posts
    22
    Rep Power
    0

    Default Code runs fine but get compile error

    Hi everyone. I am new to Java programming and have a book that I am using to learn the programming. I have created the following class and it runs fine without errors but when I compile the code using Eclipse, it tells me there are errors. Am I missing something in the code? Thank you.

    public class MultiplicationTable
    {
    public static void main(String[] args)
    {
    System.out.print("\t 0 \t 1 \t 2 \t 3 \t 4 \t 5\t " +
    "6 \t 7 \t 8 \t 9");
    System.out.println();

    for(int x = 0; x<=9; x++)
    {
    System.out.print(x + "\t ");

    for(int y=0; y<=9; y++)
    {
    System.out.print(x*y + "\t ");

    }
    System.out.println();
    }
    }

    }

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Quote Originally Posted by BillyB View Post
    Am I missing something in the code?
    I'm not sure, but you left the error message texts out of your post. :(

  3. #3
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,755
    Rep Power
    19

    Default

    How does it run if it doesn't compile?

  4. #4
    Kael's Avatar
    Kael is offline Member
    Join Date
    Nov 2010
    Posts
    4
    Rep Power
    0

    Default

    Hey BillyB! I just complied your code and it complied perfectly for me. Do you have the In.class extra classpath? Because I think that's the problem tbh. :)

  5. #5
    BillyB is offline Member
    Join Date
    Nov 2010
    Posts
    22
    Rep Power
    0

    Default Found the problem

    Thanks to all who responded. I just learned that if any class has an error in a project, Eclipse lets you know. There was a problem with code in another class in the project. Thanks again.

Similar Threads

  1. Replies: 1
    Last Post: 11-03-2010, 08:49 AM
  2. Can not compile code , anyone help me fix it ?
    By batista11b5 in forum New To Java
    Replies: 3
    Last Post: 10-22-2010, 02:00 PM
  3. error while compile code using javac
    By suri in forum New To Java
    Replies: 3
    Last Post: 01-20-2010, 09:10 AM
  4. Code compiles in/runs in IDE but not on UNIX system
    By Unclejunebug in forum New To Java
    Replies: 7
    Last Post: 10-08-2009, 08:35 AM
  5. Code will not compile
    By ShotGunRockets in forum New To Java
    Replies: 17
    Last Post: 05-10-2009, 03:31 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
  •