-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDataTypes.java
More file actions
37 lines (33 loc) · 892 Bytes
/
DataTypes.java
File metadata and controls
37 lines (33 loc) · 892 Bytes
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
public class DataTypes {
static byte b;
static short s;
static int i;
static long l;
static float f;
static double d;
static char c;
static boolean bool;
public static void print() {
System.out.println("byte = " + b);
System.out.println("Short = " + s);
System.out.println("int = " + i);
System.out.println("long = " + l);
System.out.println("float = " + f);
System.out.println("double = " + d);
System.out.println("char = " + c);
System.out.println("boolean = " + bool + "\n");
}
public static void main(String[] args) {
print();
b = 1;
s = 102;
i = 999;
l = 4324324;
f = 23.542369f;
d = 12.1235494854654;
c = 'a';
bool = true;
System.out.println("After Assigning Values");
print();
}
}