-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDataTypes.java
More file actions
45 lines (31 loc) · 897 Bytes
/
DataTypes.java
File metadata and controls
45 lines (31 loc) · 897 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
38
39
40
41
42
43
44
45
package section3;
public class DataTypes {
public static void main(String[] args) {
int n = 1;
float f = 1;
double d = 1;
System.out.println("integer value is " + n);
System.out.println("float value is " + f);
System.out.println("double value is " + d);
float ff = 1f;
double dd = 1d;
System.out.println("float value is " + ff);
System.out.println("double value is " + dd);
System.out.println();
System.out.println(9 / 2);
System.out.println(9f / 2f);
System.out.println(9d / 2d);
System.out.println();
System.out.println(10f / 6f);
System.out.println(10d / 6d);
System.out.println();
System.out.println(10f / 6);
System.out.println(10d / 6);
System.out.println();
System.out.println(10 / 6f);
System.out.println(10 / 6d);
// unicode character - https://unicode-table.com/
System.out.println();
System.out.println('§');
}
}