Skip to content

Commit 5bd6b12

Browse files
committed
feat: Add Primitives class to demonstrate Java primitive data types and type casting
Add a program that: - Declares and initializes variables of various primitive types: int, char, float, double, long, boolean - Demonstrates usage of post-increment on a float variable - Includes a commented line showing how to perform explicit type casting - Provides a basic overview of memory-efficient primitive type usage in Java.
1 parent f05b5ec commit 5bd6b12

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Section5OperatorExpression/src/Primitives.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ public static void main(String[] args) {
99

1010
float c = 30.6f;
1111
c++;
12-
// c = (int)(c) + 1;
12+
13+
//c = (int)(c) + 1;
14+
1315
System.out.println(c);
1416
}
1517
}

0 commit comments

Comments
 (0)