public class CastingExample { public static void main(String[] args) { // Implicit - Cast Wide int intValue = 10; double doubleValue = intValue; // Automatically converts int to double System.out.println("Casting wide: " + doubleValue); // Explicit - Cast Narrow double anotherDoubleValue = 15.75; int anotherIntValue = (int) anotherDoubleValue; // Explicitly converts double to int System.out.println("Casting narrow: " + anotherIntValue); } }