-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprimitivedatatype.java
More file actions
54 lines (44 loc) · 1020 Bytes
/
Copy pathprimitivedatatype.java
File metadata and controls
54 lines (44 loc) · 1020 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
46
47
48
49
50
51
52
53
54
public class primitivedatatype {
public static void main(String[] args) {
/*
int a = 90;
int b = 67;
int c = a + b;
System.out.println(c);
*/
/*
float a = 3.14f;
int b = 8;
float sum = a + b ;
System.out.println(sum);
*/
/*
int a = 10;
int b = 4;
//int c = a/b;
//double c = a/b;
float c = a/b;
System.out.println(c);
*/
int a = 12;
int b = 18;
if(a<b) {
System.out.println("adult for the vote");
} else {
System.out.println(" not adult");
}
}
}
// primitive data typee
//1. integer type
//a.byte= 8{bits},range(-128 to 127)
//b.short=16{bits},range(-32768 to 32767)
//c.int=32{bits},range(-2.1B to 2.1B)
//d.long=64{bits},range(-4000T to 4000T)
//2.floating type
//a.float = (32bits),range= (3.40 x 10p38, 1.40 x 10p-45)
//b.double = (64bits),range = (1.79 x 10p308, 4.9 x 10p-324)
// character type
//a.char = (16bits),range 0 to 65536-unicode
// boolean type
//boolean = m/cdependent range : {true , false}