当前位置: 技术问答>java相关
谁能说出Applet中init()的真正作用?100大洋
来源: 互联网 发布时间:2015-04-03
本文导语: 刚开始还有点明白,现在我越来越糊涂了,其实不用init() 很多东西也可以初始化的啊 | 初始化的时候Applet会被调用在内存中,只要不去手工中断或关闭浏览器,这个Applet会一直持续在内存中...
刚开始还有点明白,现在我越来越糊涂了,其实不用init()
很多东西也可以初始化的啊
很多东西也可以初始化的啊
|
初始化的时候Applet会被调用在内存中,只要不去手工中断或关闭浏览器,这个Applet会一直持续在内存中,哪怕你到别的页面转了一圈。
简单的说,init()方法类似main(),是启动的applet的开始。
总不能说因为main()方法的事情都可以由别的方法完成就不去用main()?
简单的说,init()方法类似main(),是启动的applet的开始。
总不能说因为main()方法的事情都可以由别的方法完成就不去用main()?
|
An applet's life cycle is controlled by the browser. The four functions
1. init()
2. start()
3. stop()
4. destroy()
are called by the browser at various times.
init() is, in some sense, like a constructor, and is called when the applet is first loaded.
start() is called when the browser starts the applet's execution when the page is first loaded or revisited.
stop() is called when the browser stops the execution of the applet. For example, when the user leaves the page or closes the browser.
destory() is, in some sense, like a destrutor and called when the applet is unloaded.
1. init()
2. start()
3. stop()
4. destroy()
are called by the browser at various times.
init() is, in some sense, like a constructor, and is called when the applet is first loaded.
start() is called when the browser starts the applet's execution when the page is first loaded or revisited.
stop() is called when the browser stops the execution of the applet. For example, when the user leaves the page or closes the browser.
destory() is, in some sense, like a destrutor and called when the applet is unloaded.
|
其实不用init()很多东西也可以初始化的啊!!!
init()初始化一次
init()初始化一次
您可能感兴趣的文章:
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。