📚 Practice Mode

Java Programming with Database Connectivity

Learn at your own pace with hints and detailed explanations

1 / 19
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); } }

  1. The program will output 'hello:1:2.0:false'
  2. The program will throw Input Mismatch exception at the run-time
  3. The program will output nothing.
  4. The program will ouput ':1:2.0:false'