Multiple choice technology

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'

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

The Scanner reads each token sequentially using space as delimiter: 'hello' as String, 1 as int, 2.00 as float (formatted as 2.0), and false as boolean. The println concatenates these with colons between values.