Results 1 to 10 of 10
  1. #1
    ls7897 is offline Member
    Join Date
    Nov 2010
    Posts
    38
    Rep Power
    0

    Default Unresolved compilation problem

    Thanks for the help!
    Last edited by ls7897; 03-09-2011 at 04:31 AM.

  2. #2
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,069
    Blog Entries
    3
    Rep Power
    8

    Default

    What exactly are your errors?

  3. #3
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,069
    Blog Entries
    3
    Rep Power
    8

    Default

    Where is your main method?

  4. #4
    ls7897 is offline Member
    Join Date
    Nov 2010
    Posts
    38
    Rep Power
    0

    Default

    Quote Originally Posted by sunde887 View Post
    What exactly are your errors?
    Updated post! :)

  5. #5
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,069
    Blog Entries
    3
    Rep Power
    8

    Default

    Go to line 55 and you will find the problem. I'd rather not follow a link to see your code. Please type [ code] at the beginning and [/code] at the end. Paste your code in between and dont put any spaces in the tags.

  6. #6
    ls7897 is offline Member
    Join Date
    Nov 2010
    Posts
    38
    Rep Power
    0

    Default

    editttttttttttt
    Last edited by ls7897; 03-09-2011 at 04:31 AM.

  7. #7
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,069
    Blog Entries
    3
    Rep Power
    8

    Default

    Try putting the my calc code in one file, the main doesn't need to be in the same file, but for most programs I use it in the same class. For the most part, however; I don't see any problems. What happens if you manually compile in cmd? One thing that's unrelated is you can use a switch case instead of all the if else clauses.

  8. #8
    ls7897 is offline Member
    Join Date
    Nov 2010
    Posts
    38
    Rep Power
    0

    Default

    Quote Originally Posted by sunde887 View Post
    Try putting the my calc code in one file, the main doesn't need to be in the same file, but for most programs I use it in the same class. For the most part, however; I don't see any problems. What happens if you manually compile in cmd? One thing that's unrelated is you can use a switch case instead of all the if else clauses.
    Only problem I can think of is that Eclipse isn't automatically adding the import java.utils... etc

    I'll try in CMD (Or terminal)

    Edit: In terminal, I'm getting

    ''SimpleCalc.java:21: illegal character: \0
    public int displayMenu() {
    ^
    SimpleCalc.java:21: ';' expected
    public int displayMenu() {
    ^
    SimpleCalc.java:35: illegal character: \0
    public void controlMenu() {
    ^
    SimpleCalc.java:35: ';' expected
    public void controlMenu() {
    ^
    4 errors
    ''
    Last edited by ls7897; 03-09-2011 at 02:27 AM.

  9. #9
    ls7897 is offline Member
    Join Date
    Nov 2010
    Posts
    38
    Rep Power
    0

    Default

    Got it working! It seems that Eclipse wasn't automatically using the import statements (import java.util.Scanner;).

    Seems to work now terminal! Thanks for the help guys!

  10. #10
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,069
    Blog Entries
    3
    Rep Power
    8

    Default

    It's probably a good idea to always include import statements.

Similar Threads

  1. Replies: 2
    Last Post: 11-06-2011, 05:40 PM
  2. Replies: 6
    Last Post: 12-04-2010, 09:36 AM
  3. Replies: 0
    Last Post: 06-20-2010, 06:23 PM
  4. Unresolved compilation problem
    By mew in forum New To Java
    Replies: 2
    Last Post: 12-30-2007, 08:17 PM
  5. Unresolved compilation problem
    By mew in forum New To Java
    Replies: 3
    Last Post: 12-11-2007, 12:49 PM

Posting Permissions

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