forked from examplehub/Java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDataType.java
More file actions
42 lines (32 loc) · 933 Bytes
/
DataType.java
File metadata and controls
42 lines (32 loc) · 933 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
package com.examplehub.basics;
public class DataType {
public static void main(String[] args) {
byte flag = 1;
System.out.println(flag);
System.out.println(Byte.SIZE);
char num = 'a';
System.out.println(num);
System.out.println(Character.SIZE);
short age = 123;
System.out.println(age);
System.out.println(Short.SIZE);
int number = 123456;
System.out.println(number);
System.out.println(Integer.SIZE);
long bigNumber = 123456789;
System.out.println(bigNumber);
System.out.println(Long.SIZE);
float pi = 3.1415926f;
System.out.println(pi);
System.out.println(Float.SIZE);
double price = 2.50;
System.out.println(price);
System.out.println(Double.SIZE);
boolean swapped = true;
System.out.println(swapped);
boolean yesOrNo = false;
System.out.println(yesOrNo);
String name = "Java";
System.out.println(name);
}
}