Flashcards in Chapter 2 - revisited Deck (6)
when using the scanner class - how do you scan in more than one number in a row? how are the prompt(s) used with the scan.in ?
only one string statement is needed before implementing several scanner objects. you do not need to repeat the string statement.
System.out.println(" please enter the two numbers")
num1 = scan.nextInt()
num2 = scan.nextInt()
what is the statement used to invoke the scanning method and giving it a variable name?
scanner scan = new scanner (System.in);
^class ^variable name for the scanning method.
when using the scan method we concadinate the variable name we chose with the type of data coming in.
what is a numeric literal?
numeric literal is a number
what are variables?
variables: words that hold values and can change in value.
how are character variables instantiated? what is the format?
char letterChosen = 'A';
^type ^variable name ^ the single ' is used for characters whereas a double " is used for strings.