On Wed, Sep 7, 2011 at 11:58 PM, billconan <billco...@gmail.com> wrote:
> suppose I have a function named kkk > Why ... why would you name your function that ... ? > which overrides the function aaa, > That doesn't make sense. You can't override a function with a different name. Let's assume you meant "kkk" again. > if I want to call aaa from kkk, I wrote: > > @Override > protected void kkk() > { > super(); > } > > The problem is, I want to do something before calling aaa > > @Override > protected void kkk() > { > //do something here.... > > super(); > } > > But java doesn't allow me to do this, it says that super must be the > first thing inside the function. > > So how can I call super() after some other code? > You may need to brush up on Java. super() is a call to the super class *constructor*. If you want to call a super class *method* you call super.methodName() - so in your case "super.kkk()". ------------------------------------------------------------------------------------------------- TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en