Results 1 to 6 of 6
  1. #1
    IITian is offline Member
    Join Date
    Jan 2013
    Posts
    3
    Rep Power
    0

    Exclamation Urgent Help Needed for some minor Bluej Error

    I tried this code , it works fine :-
    Java Code:
    import java.util.*;
    public class god {
        public void main() {
            float chalnabey;
            Scanner in=new Scanner(System.in);
            
            System.out.println("t");
        }
    }
    But when i add a line for taking input , the red bar at left goes on progressing and it never runs ! Why ???

    Java Code:
    import java.util.*;
    public class god {
        public void main() {
            float chalnabey;
            Scanner in=new Scanner(System.in);
            chalnabey=in.nextFloat();                                             //This is addition to last code
            System.out.println("t");
        }
    }
    Please help fast , tommorows my exams :(

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

    Default Re: Urgent Help Needed for some minor Bluej Error

    Quote Originally Posted by IITian View Post
    ...

    But when i add a line for taking input , the red bar at left goes on progressing ...
    Could you explain what this means?

    ...and it never runs ! Why ???
    How are you sure that it never runs? Have you tried entering a number to see what happens?

    It might be clearer to you that you need to enter a number if you add a prompt, a String that reminds you to enter data:

    Java Code:
    import java.util.*;
    public class god {
        public void main() {
            float chalnabey;
            Scanner in=new Scanner(System.in);
            System.out.print("Please enter a number: ");
            chalnabey=in.nextFloat();                         
            System.out.println("t");
        }
    }
    Also, we greatly appreciate it if you leave "urgent" and similar messages out of your question. Your question is no more important than any other question on this site. You'll be much better served if in your question heading you post a very brief summary of your current problem rather than non-specific text such as "urgent help needed for some ...". Tell us exactly what is wrong in that heading, but again, without the urgency.
    Last edited by Fubarable; 01-09-2013 at 06:34 PM.

  3. #3
    IITian is offline Member
    Join Date
    Jan 2013
    Posts
    3
    Rep Power
    0

    Default Re: Urgent Help Needed for some minor Bluej Error

    I compiled , it compiles without any error but when i right click and select "new void main()" then JVM loader at left seems to load indefinatly , i didnt find any possible error in code but when i remove that line "chalnabey=in.nextInt();" , it works perfectly ?

    Okay next time o=i will not use 'urgent' and similair words :)

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

    Default Re: Urgent Help Needed for some minor Bluej Error

    Quote Originally Posted by IITian View Post
    when i right click and select "new void main()"
    You what?

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

  5. #5
    IITian is offline Member
    Join Date
    Jan 2013
    Posts
    3
    Rep Power
    0

    Default Re: Urgent Help Needed for some minor Bluej Error

    Okay i have made a video itself for you to understand the situation :)
    yakin - YouTube

  6. #6
    harshit shah is offline Member
    Join Date
    Jan 2013
    Location
    Kolkata,India
    Posts
    86
    Rep Power
    0

    Default Re: Urgent Help Needed for some minor Bluej Error

    okay if you are using BlueJ
    then here is the error.your program works fine...but the red bar at left goes on progressing tells you that your program is running.
    So what you have to do is open the terminal window by pressing Ctrl+t and the program shall run fine
    regards
    harshit

Similar Threads

  1. Urgent Help Needed
    By debu_cha in forum Advanced Java
    Replies: 3
    Last Post: 12-07-2010, 10:02 PM
  2. ERROR DEPLOYING WEB APPLET......help needed urgent
    By bonjovi4u in forum Java Applets
    Replies: 1
    Last Post: 03-16-2010, 04:16 PM
  3. Urgent Help Needed
    By Cid17 in forum New To Java
    Replies: 10
    Last Post: 07-03-2009, 03:42 PM
  4. hi help needed, this is urgent
    By msciriha in forum NetBeans
    Replies: 1
    Last Post: 02-07-2009, 07:16 PM
  5. Urgent help needed here pls!!
    By Manfizy in forum NetBeans
    Replies: 5
    Last Post: 01-28-2009, 08:38 AM

Tags for this Thread

Posting Permissions

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