I have a method in a Class DateButton. And Im currently working on another Class MyApplication. Now the DateButton class is too generic to modify. And I need to modify a method in it. So, Im trying to override that method as follows in MyApplication.
I would like to mention that each of these two files is in a seperate package. Also they are no way related!.Also the DateButton class extends AbstractDateButton.So, obviously, the call-->super.postUp() of DateButton is calling the one in the AbstractDateButton class.
But,when Im trying to overlaod this method in the MyApplication class..the "super.postUp()" method is actually calling the method in the DateButton; Now my issue gets resolved if I somehow manage to call the method in AbstractDateButton.
Here is my code!
Please do let me know what I am missing here...also please let me know why this call "super.postUp()" in MyApplication is calling the one in DateButton and not the one in AbstractDateButton.
Pavan Dittakavi wrote:Please do let me know what I am missing here...also please let me know why this call "super.postUp()" in MyApplication is calling the one in DateButton and not the one in AbstractDateButton.
Like Garret said, your anonymous class extens DateButton. So that's it's its parent, and not AbstractDateButton. To call a super super method isn't allowed in Java (because of encapsulation). You could only provide a method in DateButton like 'superPostUp()'. Look at the example below:
Censorship is the younger of two shameful sisters, the older one bears the name inquisition. -- Johann Nepomuk Nestroy
I could have well done that!. But the thing is, if I try to call the "postUp" method in the DateButton class..the functionality gets hampered!!. I mean there is additional code in the DateButton class and if it gets processed then we will be having some issues.