Results 1 to 6 of 6
  1. #1
    Ecthelion II is offline Member
    Join Date
    Jun 2012
    Posts
    5
    Rep Power
    0

    Unhappy Just began, need help!

    Hi guys!

    So, I just starting learning Java, and ran into an error with my user input program.

    Here's the code:

    PHP Code:
    import java.util.Scanner
    
    public class apples {
    	public static void main(String args[]) {
    		Scanner pie = new Scanner(System.in);
    		System.out.println(pie.nextLine());
    	}
    }
    The error message says:


    "Exception in thread "main" java.lang.Error: Unresolved compilation problem:

    at apples.main(apples.java:4)"

    Any help would be great, thanks!

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

    Default Re: Just began, need help!

    You're trying to run code that doesn't compile. The first thing to do is to never try to do this. Instead compile it, and then carefully look at the compiler errors, and fix them before running the code. You may need to look above the line that causes the compiler error to check on the semicolon that's missing.

    As an aside, welcome to the java-forums.org. We're glad that you've decided to join us and we look forward to seeing your posts, both questions and answers, in the future. One suggestion: for you next question, make your question title more informative. "need help" doesn't tell us anything that we don't already know (else why would you post a question here). Instead consider this section as similar to a newspaper article's headline: a very short summation of your problem. Yours might be "Unresolved compilation problem" or something similar.
    Last edited by Fubarable; 06-28-2012 at 11:59 PM.

  3. #3
    Ecthelion II is offline Member
    Join Date
    Jun 2012
    Posts
    5
    Rep Power
    0

    Default Re: Just began, need help!

    Yay! Thank you, that worked perfectly. I'm new to coding, and this is my first language so...

    Thanks!

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

    Default Re: Just began, need help!

    Quote Originally Posted by Ecthelion II View Post
    Yay! Thank you, that worked perfectly. I'm new to coding, and this is my first language so...

    Thanks!
    You're quite welcome! We'll be seeing you around hopefully.

  5. #5
    Ecthelion II is offline Member
    Join Date
    Jun 2012
    Posts
    5
    Rep Power
    0

    Default Re: Just began, need help!

    Yes! I hope to make some progress!

  6. #6
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,423
    Rep Power
    20

    Default Re: Just began, need help!

    Please go through the Forum Rules -- particularly the third paragraph.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Just Began: Help needed with Arrays
    By Ichythus in forum New To Java
    Replies: 2
    Last Post: 06-28-2010, 05:17 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
  •