Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

"init" API...

 
Eros Nikhil
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using an API "init" which has two versions...with the following signatures...
Version 1. init (String, Applet)
Version 2. init (String, MTIApplet)...........please note MTIApplet is inherited from Applet.
My Applet class is inherited from MTIApplet and wants to call this method.
My code is like....Classname.init ("xyz", this).
Since, I am passing "this" object which is a direct child of MTIApplet...I do not expect any change in my code from Version 1 to Version 2.
As expected, I am able to compile my file with both Version 1 & Version 2 without any changes.
But surprisingly at runtime..my class file compiled with Version 1 API works fine but my class compiled using Version 2 API fails with a NoSuchMethodError in Java runtime environment!
Normally, the compiler won't allow compilation if there is a type mis-match, nope...how come the compiler does not detect anything??
Do u have some clue on this?? What could be happening??
Thanx in advace :-)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic