Scanner class:A class in Java that allows users to read input from various sources using methods like nextBoolean(). It provides functionality for parsing primitive types and strings.
hasNextBoolean(): A method in Java's Scanner class that checks if there is another token available in the input source and returns true if it is a boolean.
parseBoolean(): A method in Java's Boolean class that converts a string representation of a boolean ("true" or "false") into its corresponding boolean value.