There are basically two types of programs that can be built in java i.e. Applications and Applets
Applications can be directly executed by a JVM.
Applets require a web browser to execute, browser includes a JVM and also provides an execution environment for the applet. Applet can interact with the browser. We can also run applets using applet viewer tool. It is included in the Java Development Kit (JDK).
Applets are downloaded from a web server to a users's system. It is done automatically when a web page includes a reference to an applet. An applet can be downloaded from a web server and executed on a client PC or workstation.