so I am using a while loop to check if the string entered by a user is an empty string, and if it is it results in an error, and then asks a question again and if it is valid does not repeat. I got this, but how would I also check for a string longer then 60 characers that does the same as as the empty string and also check to see if the string ends in a question mark. As in how would I implement the multiple checks within the loop
while ( x.length() == 0||x.length >100){
System.out.println("empty string not allowed .");
System.out.print( "ask another question: " );
x = scan.nextLine();
}
So I have a loop which checks multiple conditions where I have the error message for empty string and this prints out if the string entered is empty, greater than 100 characters, or doesn't end in question mark. it will continue through until a valid question is input. How would I implement the error messages for just if the empty string is entered or a string that is greater than 100 or a string that doesnt end with a question mark