In the first example, the type - Emp - has to be known and decided-upon at compile-time, whereas in the second, the decision can be deferred until runtime. This is how applications such as Tomcat can work with classes you write, which the developers of Tomcat knew nothing about when they wrote Tomcat