public class MyClass { public static void main(String[] args) { double myDouble = 9.78; int myInt = (int) myDouble; // Explicit casting: double to int System.out.println(myDouble); System.out.println(myInt); } }