• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

init() method

 
tilak kumar
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
instead of init() mathod can we declare our own constructor
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24208
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can define a contructor, yes, but there are things you can only do in init(). In particular, your "AppletStub" won't be set, yet, while the constructor is running, so you can't get applet parameters, load images from URLs, load sound files, etc. All of these things have to be deferred until init() time.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic