Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

difference between applet & application.

Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would be thankful if any one could tell me the difference between an applet and an application and at the same time the difference between an application and a servlet.Waiting for ur answer at the earliest thanks.
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Rajitha,
An applet is a small code that runs on your browser. An application can run on its own. A servlet is a code that runs on your web server to fulfill the client's request. This is the basic difference. If you want to know more differences e-mail me back.
Rajitha Ereddy
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Vatsa,
Thanks for letting me know the differences and i would me more
thankful if you let me know the other diffrences also.
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This info i took from a web site and from the java tutorial
Basically, an applet runs in a browser, loaded from an APPLET tag in an HTML file. The browser than calls applet life-cycle methods like start(), stop(), init(), and destroy() as needed. There are security restrictions an applet must abide by.
An application is started from the command line (java command) and starts with the main() method. There are no life-cycle methods which are automatically called within an application, nor are there security restrictions (by default).
In an applet and an application with a Frame/Window, the paint() method is automatically called to update the screen.
What Applets Can and Can't Do
Security Restrictions
Current browsers impose the following restrictions on any applet that is loaded over the network:
An applet cannot load libraries or define native methods.
It cannot ordinarily read or write files on the host that's executing it.
It cannot make network connections except to the host that it came from.
It cannot start any program on the host that's executing it.
It cannot read certain system properties.
Windows that an applet brings up look different than windows that an application brings up.
Each browser has a SecurityManager object that implements its security policies. When a SecurityManager detects a violation, it throws a SecurityException. Your applet can catch this SecurityException and react appropriately.
Applet Capabilities
The java.applet package provides an API that gives applets some capabilities that applications don't have. For example, applets can play sounds, which other programs can't do yet.
Here are some other things that current browers and other applet viewers let applets do:
Applets can usually make network connections to the host they came from.
Applets running within a Web browser can easily cause HTML documents to be displayed.
Applets can invoke public methods of other applets on the same page.
Applets that are loaded from the local file system (from a directory in the user's CLASSPATH) have none of the restrictions that applets loaded over the network do.
Although most applets stop running once you leave their page, they don't have to.
I need a new interior decorator. This tiny ad just painted every room in my house purple.
Thread Boost feature
    Bookmark Topic Watch Topic
  • New Topic