-
Notifications
You must be signed in to change notification settings - Fork 0
/
input.java
27 lines (21 loc) · 888 Bytes
/
input.java
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
import java.util.Locale;
import java.util.Scanner;
public class input {
public static void main(String[] args)
{
Scanner scan = new Scanner(System.in); //Scanner: class, scan: object
scan.useLocale(Locale.US); //US standards
System.out.println("Enter a integer value: ");
int a = scan.nextInt();
System.out.println("Value of a: " + a);
System.out.println("------------");
System.out.println("Enter a float value: ");
float b = scan.nextFloat();
System.out.println("Value of b: " + b);
System.out.println("------------");
System.out.println("Enter a string: ");
scan.nextLine(); // '\n'(enter) karakterini stringe atmasın diye boş bir scan yapıyoruz.
String k = scan.nextLine();
System.out.println("k : " + k);
}
}