Applet Interview Question and Answers

5. What is the difference between applications and applets?
  • Application must be run on local machine whereas applet needs no explicit installation on local machine.
  • Application must be run explicitly within a java compatible virtual machine where as applet loads and runs itself automatically in a java enabled browser.
  • Application starts execution with its main method whereas applet starts execution with its init method.
  • Application can run with or without graphical user interface whereas applet must run within a graphical user interface.
Your Name Your Email-ID
Your Answer
6. When is update method called?
  • Whenever we minimize, maximize, restart the applet and explicitly calling the repaint() method in the code.
  • Repaint() method will implicitly call the update() method.
Your Name Your Email-ID
Your Answer
7. How will you communicate between two applets?
  By creating URL objects, URLConnection object and getting InputStream, OutputStream Using getInputStream(), getOutputStream().
Your Name Your Email-ID
Your Answer
8. How do I load a serilalized applet?
  Instead of specifying the CODE attribute of an
OBJECT = TheApplet.ser
WIDTH =300
HEIGHT = 300
This allows you to pre-initialize your applet to some saved state, instead of having to reinitialize your applet each time it is loaded.
Your Name Your Email-ID
Your Answer
1234 Page 2 of 4