- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDataTypeSizes.java
More file actions
Latest commit
23 lines (17 loc) · 708 Bytes
/
Copy pathDataTypeSizes.java
File metadata and controls
23 lines (17 loc) · 708 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* Computer Programming 1
data types
*/
importjava.io.*;
importjava.util.*;
publicclassDataTypeSizes
{
publicstaticvoidmain(String[] args) {
System.out.println("Size of byte: " + (Byte.SIZE/8) + " bytes.");
System.out.println("Size of short: " + (Short.SIZE/8) + " bytes.");
System.out.println("Size of int: " + (Integer.SIZE/8) + " bytes.");
System.out.println("Size of long: " + (Long.SIZE/8) + " bytes.");
System.out.println("Size of char: " + (Character.SIZE/8) + " bytes.");
System.out.println("Size of float: " + (Float.SIZE/8) + " bytes.");
System.out.println("Size of double: " + (Double.SIZE/8) + " bytes.");
}
}