+ 1

What does overriding means in java?

4th Nov 2016, 4:19 PM
Viraj Singh
Viraj Singh - avatar
5 Réponses
+ 3
here is an example that you may want to check to see difference or understand the meanings of overriding and overloading https://code.sololearn.com/c0awDMpDLukF/?ref=app
11th Sep 2017, 3:02 PM
Melih Melik Sonmez
Melih Melik Sonmez - avatar
+ 2
What is diffrence between overriding a piece of code frome some class and inheriting the class by "extends" keyword ?
4th Nov 2016, 5:38 PM
Viraj Singh
Viraj Singh - avatar
+ 1
you can override some inherited code structure for example methods or variables if you have two classes: based and derived in derived you can override public void example(){System.out.println("something");} with public void example(){System.out.println("nothing");}
4th Nov 2016, 5:32 PM
Maciej Góraj
Maciej Góraj - avatar
+ 1
but dont confuse with overloading this is writing few methods with the same name and return type but with different type of count parameters
4th Nov 2016, 5:36 PM
Maciej Góraj
Maciej Góraj - avatar
+ 1
in extending you take the methods of base class and now you can overriding this methods word extends means like this class is subclass of base class override is redefine of supeclass code for specific task in subclass
4th Nov 2016, 5:43 PM
Maciej Góraj
Maciej Góraj - avatar