What is the difference between an Applet and a Servlet and what are a few examples on how each of them are used? I am new to networking am I am wondering how these things are different.
-
3You should read up on Oracle's website or Wikipedia before asking such simple questions. – David Brossard Sep 29 '14 at 15:51
-
possible duplicate of [Applet v/s Servlet](http://stackoverflow.com/questions/1723845/applet-v-s-servlet) – blo0p3r Sep 29 '14 at 16:41
2 Answers
From Wikipedia: A Java applet is a small application which is written in Java and delivered to users in the form of bytecode. The user launches the Java applet from a web page, and the applet is then executed within a Java Virtual Machine (JVM) in a process separate from the web browser itself. Applets are used to provide interactive features to web applications that cannot be provided by HTML alone. They can capture mouse input and also have controls like buttons or check boxes. In response to user actions, an applet can change the provided graphic content. This makes applets well-suited for demonstration, visualization, and teaching.
A servlet is a Java programming language class used to extend the capabilities of a server. Although servlets can respond to any types of requests, they are commonly used to extend the applications hosted by web servers. Servlets are the Java counterpart to other dynamic Web content technologies such as PHP and ASP.NET. In other words, a Servlet is an object that receives a request and generates a response based on that request.

- 775
- 1
- 4
- 14
An Applet is for client side execution, generally graphical components.
Servlet is for server side execution, with no graphical components, but can return HTML or any kind of data (generally called a service
).

- 2,586
- 1
- 16
- 16