Java Override | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Java Override

class Example{ public void function(String S){} public void function(int i){} } Is this function Overriding in Java? Only the input types are different.

1st Mar 2019, 2:25 AM
Susanta Paul
Susanta Paul - avatar
2 Answers
+ 10
This is not overriding, its called function overloading. In overriding, there is some method in the parent class with its own definition and the same method with same parameters is present in the child class but with different definition.
1st Mar 2019, 3:30 AM
blACk sh4d0w
blACk sh4d0w - avatar
1st Mar 2019, 5:13 AM
Lambda_Driver
Lambda_Driver - avatar