Results 1 to 4 of 4
  1. #1
    Input is offline Member
    Join Date
    Dec 2013
    Posts
    10
    Rep Power
    0

    Default Output not showing in run window after copying code

    Hello - I've copied some code from a tutorial and though I'm not getting an error message or anything I'm not getting the expected out put either and I'm not sure why.

    Here's my window with the code and the (lack of) out put:



    here's what I have copied, with the expected recurring hello output at the bottom of their window :




    Was just wondering if there's some little rule or idiosyncrasy that I'm unaware of that would lead to this...

    Thanks

  2. #2
    Input is offline Member
    Join Date
    Dec 2013
    Posts
    10
    Rep Power
    0

    Default Re: Output not showing in run window after copying code

    Ahhh sorry I just did it immediately after posting this - it was because I had a little " ; " after the while(value < 10)

    I thought they were meant to come after everything, so I'm not too sure why they affected that there or why they're undesirable there!

  3. #3
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,658
    Blog Entries
    7
    Rep Power
    21

    Default Re: Output not showing in run window after copying code

    A single semi colon is an empty statement, so:

    Java Code:
    while (value < 10);
    ... executes the empty statement over and over again (if value was less than 10 to start with).

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  4. #4
    Input is offline Member
    Join Date
    Dec 2013
    Posts
    10
    Rep Power
    0

    Default Re: Output not showing in run window after copying code

    I need to read about statements then, nice one

Similar Threads

  1. Replies: 0
    Last Post: 08-07-2011, 08:32 PM
  2. Replies: 4
    Last Post: 03-16-2011, 04:40 PM
  3. Showing each window
    By stoxic in forum AWT / Swing
    Replies: 3
    Last Post: 03-13-2011, 06:47 PM
  4. Java and WebServices: showing a Loading window
    By BeRniTo in forum Advanced Java
    Replies: 0
    Last Post: 11-06-2009, 04:33 AM
  5. Replies: 1
    Last Post: 02-20-2009, 03: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
  •