-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDataType.java
More file actions
42 lines (42 loc) · 1.44 KB
/
Copy pathDataType.java
File metadata and controls
42 lines (42 loc) · 1.44 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
37
38
39
40
41
42
public class DataType {
public static void main(String[] args) {
//byte
System.out.println("Data type: Byte");
byte b='a';
byte byt=67;
System.out.println(b+byt);
System.out.println(Byte.BYTES);
System.out.println(Byte.SIZE);
System.out.println(Byte.MAX_VALUE);
System.out.println(Byte.MIN_VALUE);
//char
System.out.println("Data type: Char");
char c='D';
System.out.println(c);
//short
System.out.println("Data type:short");
short st=60;
System.out.println(st);
System.out.println(Short.MAX_VALUE);
System.out.println(Short.MIN_VALUE);
System.out.println(Short.BYTES);
System.out.println(Short.SIZE);
//int
System.out.println(Integer.MAX_VALUE);
System.out.println(Integer.MIN_VALUE);
System.out.println(Integer.BYTES);
System.out.println(Short.SIZE);
//long
System.out.println("Data type:Long");
System.out.println(Long.MIN_VALUE);
System.out.println(Long.MAX_VALUE);
//Float
System.out.println("Data type:Float");
System.out.println(Float.MIN_VALUE);
System.out.println(Float.MAX_VALUE);
//Double
System.out.println("Data type:Double");
System.out.println(Double.MIN_VALUE);
System.out.println(Double.MAX_VALUE);
}
}