-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDataTypeTest.java
More file actions
54 lines (47 loc) · 1.94 KB
/
Copy pathDataTypeTest.java
File metadata and controls
54 lines (47 loc) · 1.94 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
43
44
45
46
47
48
49
50
51
52
53
54
public class DataTypeTest {
public static void main(String[] args) {
//-128 to 127
byte b = -128;
System.out.println("b is "+b);
System.out.println("Max value for a byte "+Byte.MIN_VALUE);
System.out.println("Min value for a byte "+Byte.MAX_VALUE);
System.out.println("Size for byte "+Byte.SIZE+" bits");
System.out.println("--------------");
System.out.println();
short s = 234;
System.out.println("s is "+s);
System.out.println("Max value for a short "+Short.MIN_VALUE);
System.out.println("Min value for a short "+Short.MAX_VALUE);
System.out.println("Size for short "+Short.SIZE+" bits");
System.out.println("--------------");
System.out.println();
int i = 5214;
System.out.println("i is "+i);
System.out.println("Max value for a int "+Integer.MIN_VALUE);
System.out.println("Min value for a int "+Integer.MAX_VALUE);
System.out.println("Size for short "+Integer.SIZE+" bits");
System.out.println("--------------");
System.out.println();
long l = 12586;
System.out.println("l is "+l);
System.out.println("Max value for a long "+Long.MIN_VALUE);
System.out.println("Min value for a long "+Long.MAX_VALUE);
System.out.println("Size for long "+Long.SIZE+" bits");
System.out.println("--------------");
System.out.println();
float f = 98953445534895859f;
System.out.println("f is "+f);
System.out.println("Max value for a float "+Float.MIN_VALUE);
System.out.println("Min value for a float "+Float.MAX_VALUE);
System.out.println("Size for float "+Float.SIZE+" bits");
System.out.println("--------------");
System.out.println();
double d = 789521;
System.out.println("d is "+d);
System.out.println("Max value for a double "+Double.MIN_VALUE);
System.out.println("Min value for a long "+Double.MAX_VALUE);
System.out.println("Size for long "+Double.SIZE+" bits");
System.out.println("--------------");
System.out.println();
}
}