+ 3
how does the @override work?
4 Answers
+ 7
@override: Annotation to show a method is over ridden.
Briefly, when a child class changes the behaviour of a super class method, it is said to override the method of super class. Also, one thing to keep in mind is while overriding method, return type and argument (method signature) must remain same.
+ 3
if u remove @Override annotations from the child class,it won't affect the output ..
+ 1
@overwrite is annotations used to explain that this method is overridden in child class. else it will be treated as child class's local method..
0
1 A child class can implement a parent class method based on it's requirement.
2 In anonymous class it is used as a way to extend an existing class on the fly.
3 In equals () method @override is used for semantically equality testing.