0

I am learning Android with Android Programming: The Big Nerd Ranch Guide. I am familiar with Object oriented programming in C++ but know very little of java. I know about C++ virtual functions and how they are implemented as placeholders for other functions and I believe this is what the @override is used for in android programming. But my question is why? Why was it chosen to make so many virtual functions and override them instead of, for instance, having an onclick listener with no functions until you implement them?

Maybe i just don't know enough about the details of the subject but it confuses me. I feel like overriding functions all the time is unnecessary. Could i get a good explanation as to their purpose and usefulness?

user3782260
  • 111
  • 2
  • 8
  • Basically you have to override the functions to get them to do what you want in your app. – ctzdev Jun 30 '14 at 04:37
  • 2 things -- `@Override` is a *Java* annotation, not an Android-specific one. Also, in Java, *all* instance methods are virtual. – awksp Jun 30 '14 at 04:42

0 Answers0