描述
The java.util.Scanner.hasNextBoolean() method returns true if the next token in this scanner's input can be interpreted as a boolean value using a case insensitive pattern created from the string "true|false". The scanner does not advance past the input that matched.
聲明
Following is the declaration for java.util.Scanner.hasNextBoolean() method
public boolean hasNextBoolean()
參數
NA
返回值
This method returns true if and only if this scanner's next token is a valid boolean value
異常
IllegalStateException -- if this scanner is closed