IT102 JAVA SCANNER Flashcards
When coding you often need to get information from the user. In Java you can use ______ ____to do this.
Scanner Class
Java Scanner helps you to read different types of ____like____,____,____
data , numbers(int, double), text(string), and true/false values(boolean)
The Scanner class is part of the _____.
java.util package.
The Scanner takes the user’s input and splits it into smaller parts, called _____. It usually uses whitespaces to separate these parts.
tokens
The Scanner takes the user’s input and splits it into smaller parts, called tokens. It usually uses _____ to separate these parts.
whitespaces
System: This is the ___ __ ____ in Java
Scanner: This is the name of the class
scannerName : This is the name you give to your Scanner object. You can choose any name, like input, scanner, or reader.
built in class
____: This is the built in class in Java
Scanner: This is the name of the class
scannerName : This is the name you give to your Scanner object. You can choose any name, like input, scanner, or reader.
System
System: This is the built in class in Java
____: This is the name of the class
scannerName : This is the name you give to your Scanner object. You can choose any name, like input, scanner, or reader.
Scanner
System: This is the built in class in Java
Scanner: This is the___ __ ___
scannerName : This is the name you give to your Scanner object. You can choose any name, like input, scanner, or reader.
name of the class
System: This is the built in class in Java
Scanner: This is the name of the class
____- : This is the name you give to your Scanner object. You can choose any name, like input, scanner, or reader.
scannerName
System: This is the built in class in Java
Scanner: This is the name of the class
scannerName : This is the ____ you give to your Scanner object. You can choose any name, like input, scanner, or reader.
name
_____: This creates the Scanner object and tells it where to get its input
System.in: for reading input for the keyboard
A file object: reading data from a file
A string or input stream: means the Scanner can also read data from string or other sources like network data.
New Scanner(inputSource)
New Scanner(inputSource): This creates the ___ ___and tells it where to get its input
System.in: for reading input for the keyboard
A file object: reading data from a file
A string or input stream: means the Scanner can also read data from string or other sources like network data.
Scanner object
New Scanner(inputSource): This creates the Scanner object and tells it where to get its input
____: for reading input for the keyboard
A file object: reading data from a file
A string or input stream: means the Scanner can also read data from string or other sources like network data.
System.in
New Scanner(inputSource): This creates the Scanner object and tells it where to get its input
System.in: for _____ for the ___
A file object: reading data from a file
A string or input stream: means the Scanner can also read data from string or other sources like network data.
reading input—keyboard
New Scanner(inputSource): This creates the Scanner object and tells it where to get its input
System.in: for reading input for the keyboard
_ ___ ___: reading data from a file
A string or input stream: means the Scanner can also read data from string or other sources like network data.
A file object
New Scanner(inputSource): This creates the Scanner object and tells it where to get its input
System.in: for reading input for the keyboard
A file object: ____-
A string or input stream: means the Scanner can also read data from string or other sources like network data.
reading data from a file
New Scanner(inputSource): This creates the Scanner object and tells it where to get its input
System.in: for reading input for the keyboard
A file object: reading data from a file
___ ___ ___: means the Scanner can also read data from string or other sources like network data.
A string or input stream
Scanner class in java helps you read different kinds of input,making it easier for the users to work with your program. It has various ____, each designed for a specific type of data. Learning these methods will help you use the Scanner class effectively.
methods
Scanner class in java helps you read different kinds of input,making it easier for the users to work with your program. It has various methods, each designed for a ____ ___ ___-. Learning these methods will help you use the Scanner class effectively.
specific type of data
Scanner class in java helps you read different kinds of input,making it easier for the users to work with your program. It has various methods, each designed for a specific type of data. Learning these methods will help you use the ___ ___ ___.
Scanner class effectively
If the user enters the wrong type of data - like typing letters when the program expects a number - they will see an error called ____ ____
InputMismatchException
METHODS
The scanner class in java reads a whole line of input and breaks it into smaller parts called “——–” it uses a delimiter to separate these tokens a delimiter is just a character or group of characters that acts as a “seperator”
tokens
The scanner class in java reads a whole line of input and breaks it into smaller parts called “tokens” it uses a ——- to separate these tokens a —– is just a character or group of characters that acts as a “seperator”
delimiter