-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathjava_io_II.java
More file actions
36 lines (28 loc) · 1.04 KB
/
java_io_II.java
File metadata and controls
36 lines (28 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import java.util.Scanner;
//import this package for input
public class java_io_II
{
public static void main(String[] args) {
//for input
Scanner Sc = new Scanner(System.in);
// variable "input_x" takes the input for data type x
// for integer inputs
int input_i = Sc.nextInt();
System.out.println("Input = " + input_i);
// for Long_Integer inputs
long input_l = Sc.nextLong();
System.out.println("Input = " + input_l);
// for float inputs
float input_f = Sc.nextFloat();
System.out.println("Input = " + input_f);
// for double_float inputs
double input_d = Sc.nextDouble();
System.out.println("Input = " + input_d);
// for String inputs WORD by WORD
String input_St = Sc.next();
System.out.println("Input = " + input_St);
// for String inputs Entire Line
input_St = Sc.nextLine();
System.out.println("Input = " + input_St);
}
}