When to use @override but when not to use | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 4

When to use @override but when not to use

I am confuse with it

5th Feb 2018, 3:54 PM
Gladwyn Tay
Gladwyn Tay - avatar
3 Answers
+ 10
The ability of a subclass to override a method allows a class to inherit from a superclass whose behavior is "close enough" and then to modify behavior as needed. The overriding method has the same name, number and type of parameters, and return type as the method that it overrides.
5th Feb 2018, 4:01 PM
Scooby
Scooby - avatar
+ 4
can I just use the override funct without @override
5th Feb 2018, 4:04 PM
Gladwyn Tay
Gladwyn Tay - avatar
5th Feb 2018, 4:08 PM
Diwakar
Diwakar - avatar