다음을 통해 공유


Scanner.NextBoolean Method

Definition

Scans the next token of the input into a boolean value and returns that value.

[Android.Runtime.Register("nextBoolean", "()Z", "")]
public bool NextBoolean ();
[<Android.Runtime.Register("nextBoolean", "()Z", "")>]
member this.NextBoolean : unit -> bool

Returns

the boolean scanned from the input

Attributes

Exceptions

if this Scanner has been closed.

if input has been exhausted.

if the next token can not be translated into a valid boolean value.

Remarks

Scans the next token of the input into a boolean value and returns that value. This method will throw InputMismatchException if the next token cannot be translated into a valid boolean value. If the match is successful, the scanner advances past the input that matched.

Java documentation for java.util.Scanner.nextBoolean().

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to