热门面试题与答案和在线测试
面向面试准备、在线测试、教程与实战练习的学习平台

通过聚焦学习路径、模拟测试和面试实战内容持续提升技能。

WithoutBook 将分主题面试题、在线练习测试、教程和对比指南整合到一个响应式学习空间中。

面试准备

Java Applet 面试题与答案

问题 6. What are the Applets Life Cycle methods? Explain them?

methods in the life cycle of an Applet: 

  • init( ) method - called when an applet is first loaded. This method is called only once in the entire cycle of an applet. This method usually intialize the variables to be used in the applet.
  • start( ) method - called each time an applet is started.
  • paint( ) method - called when the applet is minimized or refreshed. This method is used for drawing different strings, figures, and images on the applet window.
  • stop( ) method - called when the browser moves off the applet's page.
  • destroy( ) method - called when the browser is finished with the applet.

这有帮助吗? 添加评论 查看评论
 

问题 7. What is the sequence for calling the methods by AWT for applets?

When an applet begins, the AWT calls the following methods, in this sequence:

  1. init()
  2. start()
  3. paint() 

When an applet is terminated, the following sequence of method calls takes place:

  1. stop()
  2. destroy()

这有帮助吗? 添加评论 查看评论
 

问题 8. How do Applets differ from Applications?

Following are the main differences:

Application: Stand Alone, doesn't need web-browser.

Applet: Needs no explicit installation on local machine. Can be transferred through Internet on to the local machine and may run as part of web-browser.

Application: Execution starts with main() method. Doesn't work if main is not there.

Applet: Execution starts with init() method.

Application: May or may not be a GUI.

Applet: Must run within a GUI (Using AWT). This is essential feature of applets.

这有帮助吗? 添加评论 查看评论
 

问题 9. Can we pass parameters to an applet from HTML page to an applet? How?

We can pass parameters to an applet usingtag in the following way:

  • <param name="param1″ value="value1″>
  • <param name="param2″ value="value2″>

Access those parameters inside the applet is done by calling getParameter() method inside the applet. Note that getParameter() method returns String value corresponding to the parameter name.

这有帮助吗? 添加评论 查看评论
 

问题 10. In our URLs and in the text of the buttons we have comma. Its causing an error. Is there a way to change the delimiting character for the menu arguments?

Since 2.00 version our applets support an user-defined delimiter for the menu arguments. To modify the default delimiter add the following parameter (you can use any character as a delimiter):

<param name="delimiter" value="~"> and use it within "menuItems":

<param name="menuItems" value=" {Home~http://www.withoutbook.com/index.php} {Features, Setup~http://www.globalguideline.com/} ">

这有帮助吗? 添加评论 查看评论
 

用户评价最有帮助的内容:

版权所有 © 2026,WithoutBook。