forked from bayramcicek/comu2017java
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJ2inputType.java
40 lines (29 loc) · 1.09 KB
/
J2inputType.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
28
29
30
31
32
33
34
35
36
37
38
39
40
package PackageJavaNesne;
/**
* Created by cicek on 2.10.2017 00:54
*/
import java.util.Scanner;
public class J2inputType {
public static void main(String[] args){
int s1,s2;
Scanner num = new Scanner(System.in); /* "num" nesnedir */ /* "Scanner" classı/sınıfı oluşturuldu */
System.out.print("enter first number = ");
s1 = num.nextInt();
/* "num" nesnesini kullanarak "Scanner" sınıfına gitti */
System.out.print("enter second number = ");
s2 = num.nextInt();
/*
Read a byte - nextByte()
Read a short - nextShort()
Read an int - nextInt()
Read a long - nextLong()
Read a float - nextFloat()
Read a double - nextDouble()
Read a boolean - nextBoolean()
Read a complete line - nextLine()
Read a word - next()
*/
System.out.println("\nYour 1st number is = " + s1);
System.out.println("Your 2snd number is = " + s2);
}
}