can anyone give me a sample code of a while statement with more than one condition? please...

Simple example:

static int MAX_TESTS = 5;
int test = 0;
boolean result = true;
int something = 6;
while(test < MAX_TESTS && result)
{
  result = (something > 7);
  test++;
}

EDIT: Basically, the while loop takes a boolean condition. This can be the result of a single boolean method or evaluation, or multiple boolean results and'ed or or'ed together (or any other boolean arithmetic).

Edited 6 Years Ago by darkagn: Further explanation of the while loop condition

A conditional expression with more than 2 statement is just the same
as two separate conditional expression.

For example :

while( gameIsRunning )
{
        if( keyPressed )
            if( keyPressedIsX){ .. }
}

Is the same as :

while(gameIsRunning)
{
    if(keyPressed && keyPressedIsX) { ... }
}

So you see, you can think of a conditional loop with more than
1 expression as 2 or more.

Here are more examples :

do{
}while( playerIsAlive && ScoreIsNotNegative);
int grade = 0;
grade = scanner.nextInt();
if( grade >= 90 ) System.print(" You got an A" );
else if( grade >= 80 ) System.print("You got an B");
else System.print("You didn't get a B or an A\n";
This question has already been answered. Start a new discussion instead.