Java Programming with Database Connectivity
Casual Mode - Take your time!
1 / 19
Correct
0
Incorrect
0
Score
0%
Multiple Choice
import java.util.Scanner; public class ScannerTest { public static void main(String[] args) { Scanner scanner = new Scanner("hello 1 2.00 false"); scanner.useDelimiter(" "); String str = scanner.next(); int anInt = scanner.nextInt(); float aFloat = scanner.nextFloat(); boolean booleanValue = scanner.nextBoolean(); System.out.println(str + ":" + anInt + ":" + aFloat + ":" + booleanValue); } }
- The program will output 'hello:1:2.0:false'
- The program will throw Input Mismatch exception at the run-time
- The program will output nothing.
- The program will ouput ':1:2.0:false'