Computer Applications

In what way can the following data be read from the scanner object?

(a) Integer type

(b) Float type

(c) Double type

(d) String type

(e) Boolean type

Input in Java

29 Likes

Answer

(a) int a = in.nextInt();

(b) float b = in.nextFloat();

(c) double c = in.nextDouble();

(d) String str = in.nextLine();

(e) boolean d = in.nextBoolean();

Answered By

14 Likes


Related Questions