There are several mechanisms and ways of implementing modularized applications in Java. For example, you can use OSGi if you need to provide hot deployment—that is, the capability of deploying and un-deploying modules at runtime. Another option is Service Provider Interface (SPI), a set of standard interfaces and classes included in Java SE that help with the development of extensible applications. You can even use Contexts and Dependency Injection (CDI) or an inversion of control framework such as the one provided by the Spring Framework to develop a custom module system based on the injection mechanism. Moreover, you could go down to the Java Reflection API to create instances of classes not known at compile time.
Because explaining all these alternatives is out of the scope of this book, we'll use the simplest alternative...