Compile-time polymorphism in Java means the program decides which method to call before running, based on the method name and argument types. In the example, the class Demo has two methods named show: one takes an int and the other a String. When main calls d.show(5), Java chooses show(int a) because the argument is an int. When d.show("Hi") is called, Java chooses show(String a). This decision happens during compilation, so the program knows exactly which method to run. If you try to call show with a type that doesn't match any method, the compiler will give an error. This is called method overloading and helps write clear code that works with different data types.