-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path$2_DataTypesPtTwo.java
More file actions
24 lines (20 loc) · 1.03 KB
/
$2_DataTypesPtTwo.java
File metadata and controls
24 lines (20 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package src;
public class $2_DataTypesPtTwo {
public static void main(String[] args) {
byte b = 123;
System.out.println(b);
short shortDataObjectExample = (short) 12345;
int intDataObjectExample = 123456789;
long longDataObjectExample = 123456789012345L;
float floatDataObjectExample = 3.14f;
double doubleDataObjectExample = 3.141592653589793;
char charDataObjectExample = 'A';
System.out.println("This is an Object version of a Boolean example: " + true);
System.out.println("This is an Object version of a Short example: " + shortDataObjectExample);
System.out.println("This is an Object version of a Integer example: " + intDataObjectExample);
System.out.println("This is an Object version of a Long example: " + longDataObjectExample);
System.out.println("This is an Object version of a Float example: " + floatDataObjectExample);
System.out.println("This is an Object version of a Double example: " + doubleDataObjectExample);
System.out.println("This is an Object version of a Character example: " + charDataObjectExample);
}
}