Results 1 to 3 of 3
  1. #1
    JavaNovice94 is offline Member
    Join Date
    Jan 2014
    Posts
    1
    Rep Power
    0

    Default Help - Do statement

    Hi all, I've been creating a simple bank account application but it's not running properly and I believe its to do with the do statement.
    Could anybody look at this for me please? Thank-you :)

    Bankaccount - Pastebin.com

  2. #2
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    3,417
    Rep Power
    5

    Default Re: Help - Do statement

    Please don't post links to code but post the code (preferably a Short, Self Contained, Correct Example). As you are probably aware, clicking on links from relatively new folks (or even old ones) can be fraught with danger.

    Regards,
    Jim
    The Java™ Tutorial | SSCCE | Java Naming Conventions
    Poor planning our your part does not constitute an emergency on my part.

  3. #3
    AlexGraal is offline Señor Member
    Join Date
    Jan 2014
    Posts
    167
    Rep Power
    0

    Default Re: Help - Do statement

    Well, here is a link to do-while statements: The while and do-while Statements (The Java™ Tutorials > Learning the Java Language > Language Basics)


    They are the same thing as while statements, except they test for a case at the end, instead of the beginning - effectively allowing your program to run once before doing any testing.

    I think your error is in your while statement at the bottom - it should simply be
    Java Code:
     while(condition);

    Instead, you have:
    Java Code:
    while(condition); {
    //something is here
    }
    I don't even understand why that something is there - you shouldn't have { } after that while, it is simple a testing statement, not a whole new while loop.

    Read the link at the top and look at the examples.

Similar Threads

  1. Replies: 3
    Last Post: 11-19-2012, 08:12 PM
  2. Help with IF statement
    By Rahim2312 in forum New To Java
    Replies: 16
    Last Post: 05-09-2012, 04:12 PM
  3. Replies: 2
    Last Post: 03-26-2012, 04:27 PM
  4. add an If Else statement and......uh????
    By sonny in forum New To Java
    Replies: 6
    Last Post: 03-04-2010, 06:57 PM
  5. Statement or Prepared Statement ?
    By paty in forum JDBC
    Replies: 3
    Last Post: 08-01-2007, 04:45 PM

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
  •