public class TypeCasting {
public static void main(String[] args) {
int num1 = 4;
double num2 = 5.56789;
char ch = 'l';
// Casting a double to an integer
// This will truncate the decimal part
int castedNum2 = (int) num2;
System.out.println("The integer value of num2 is " + castedNum2);
// Casting a character to an integer
// It will give the ASCII value of the character
int castedCh = (int) ch;
System.out.println("The integer value of ch is " + castedCh);
}
}