Applets Interview Questions

Read all Applets Interview Questions.

  1. What is an applet? (of Applets Interview Questions)
    Applet is a Java program with special syntax to execute in a browser. Applet does not contain main() method.
  2. What is the importance of applets in Java coding? (of Applets Interview Questions)
    Applets can be loaded on client-side so that they can communicate with server (most probably with a servlet).
  3. What is life cycle? (of Applets Interview Questions)
    Different states in which an applet exist between its object creation, by the browser, and garbage collection is known as life cycle.
  4. What are life cycle methods of applet? (of Applets Interview Questions)
    There are 5 life cycle methods and an applet exists in one of these methods during it's life cycle. They are init(), start(), stop() and destroy() all defined in java.applet.Applet and paint() method defined in java.awt.Component, an indirect super class of Applet.
  5. What is the tag used to embed an applet in HTML file?
    It is <applet> tag.
  6. What is AppletContext class? (of Applets Interview Questions)
    It is used to get the reference of the execution area of an applet in the browser. Programmer can use the object of AppletContext to communicate between two servlets.
  7. How many ways exist to display messages to the user in applets? (of Applets Interview Questions)
    There exists two ways using drawString() method of java.awt.Graphics class and showStatus() method of java.applet.Applet.

Leave a Comment

Your email address will not be published.