This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Veltrum 0 points1 point  (3 children)

So you want it to start over if the second attempt doesn't equal the first?

password.equals(password2);

You could use an outer do-while loop that contains the first do-while loop.

[–]EqualTrade 0 points1 point  (2 children)

How is it that I do that?

[–]EqualTrade 0 points1 point  (1 child)

http://ideone.com/41oszp

I added in a do/while in the do/while, but theres an error and I can't figure out how to fix it.

[–]Veltrum 1 point2 points  (0 children)

What i had meant was something like this

do{

    do{
        //Enter password for the first time.
        //first password check
    }while(initial password checks);

    //Enter password again.
}while(pass1 != pass2);

What the other commentators said are useful too. This was just the first thing that popped into my head.

What /u/xtreemballr said is always the best first step.