justStartingOut wrote:no. You have some basic misunderstanding here, but I'm not sure where it's coming from, or how we can set you straight. Please review a chapter, any chapter on java primitives.
So can you only use boolean when you are dealing with numbers?
boolean a = true; // variable of boolean type if ( x < 10) // boolean expression inside if statement boolean b = x < 10; // boolean variable which is assigned the result of the boolean expression if (b) // you can now use b inside the if statement
It still has the same issue - on the second loop through it by-passes the first request for input and goes to the second input requestWithout seeing any code, I'm willing to bet that your "first request for input" obtains the input via a call to Scanner#nextLine.
Replace scanner with the reference variable for your Scanner instance. Should solve the problem.
Because the only examples I've been able to find in using boolean types is with numbers (i.e. x >= 10)What about taking a look at the basic API like String?
// Compares this string to the specified object. boolean equals(Object anObject) // Compares this String to another String, ignoring case considerations. boolean equalsIgnoreCase(String anotherString) // Tests if this string ends with the specified suffix. boolean endsWith(String suffix) // Tests if this string starts with the specified prefix. boolean startsWith(String prefix)