Results 1 to 3 of 3
Like Tree1Likes
  • 1 Post By eRaaaa

Thread: someone help me!!!!!!!!!!!!!

  1. #1
    malik666 is offline Member
    Join Date
    Nov 2011
    Posts
    1
    Rep Power
    0

    Default someone help me!!!!!!!!!!!!!

    import java.util.scanner;
    public class AbsTest{
    public static void main(String args[]){
    Scanner input = new Scanner(System.in);
    int num = input.nextint();
    if(num<0){
    num=-num;
    }
    System.out.println("Absolute value of num is"+num);
    }



    it shows error reached end of file while parsing

  2. #2
    eRaaaa is offline Senior Member
    Join Date
    Oct 2010
    Location
    Germany
    Posts
    786
    Rep Power
    5

    Default Re: someone help me!!!!!!!!!!!!!

    - import java.util.scanner; --> import java.util.Scanner;
    - int num = input.nextint(); --> int num = input.nextInt();
    - three open brackets, two closed brackets --> add } to the end

    next time, please post the error message!
    Fubarable likes this.

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

    Default Re: someone help me!!!!!!!!!!!!!

    Quote Originally Posted by eRaaaa View Post
    next time, please post the error message!
    Amen. Also, next time please use a forum question heading that means something. "help me" tells us nothing other than you need help, and we already know that, else you wouldn't be posting a question here. Instead try to make a question heading that briefly summarizes your problem, just like a newspaper headline briefly summarizes the article below.

Posting Permissions

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