Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why don't I have an error here?

 
Andrew Stallard
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Now, I have this interface called JohnnyNumber:



This interface is implemented by a class called TestOne:



Now, I do not use the method doSomethingElse() in the class even though it is in the interface, but the program runs just fine. What is going on?
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Probably, the *TestClass* implemented the missing method
 
Andrew Stallard
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is TestClass. he method do SomethingElse() has not been implemented.



Thanks anyway
 
bhanu chowdary
Ranch Hand
Posts: 256
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have just tested with your code and the compiler is throwing an error.

"The type TestOne must implement the inherited abstract method JohnnyNumber.doSomethingElse()".

Could you please check again.
 
Andrew Stallard
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


OK, I have figured it out. I changed (and recompiled) the interface when I added the additional method. However, I did not recompile the TestOne class. (I didn't think I had too because I changed no code.) Upon recompiling, the error appears.

Sorry
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic