<P>
Java Applets are not Java Servlets. Applets run on the
application side (normally in web-browsers); servlets
run on the server-side, normally as part of a middle tier
application server environment.
<P>
Regardless, servlets or applets, both are compiled Java code which executes in a platform-neutral virtual machine called the Java Virtual Machine.<P>
The purpose is to 'write once and use everywhere' by having
maching independent code. Hence, the Sun servicemark:
<P>
<EM>
The Network Is the Computer
</EM>
<P>
This concept takes time to understand. Recommend you
get a good book on high level Java architecture. You might
try:<P>
https://www.unix.com/books/middle/<P> and then search (deeper) for something more basic.