Computer Science, asked by kushboo55, 1 year ago

Difference between overloading and overriding?

Answers

Answered by BHOOMI0408
1

Heyyy mate...

Here is your answer

Overloading occurs when two or more methods in one class have the same method name but different parameters.

Overriding means having two methods with the same method name and parameters (i.e., method signature). One of the methods is in the parent class

Hope it helps!!!


ayushmaandey13: Hi bhooma
ayushmaandey13: Sry bhoomi
BHOOMI0408: hii
BHOOMI0408: mark as brainliest
ayushmaandey13: If then u will talk with me please
ayushmaandey13: Please
ayushmaandey13: Hi kuch bolo nah
Answered by Anonymous
55
Overloading and overriding

Here is a difference between overloading and overriding:

◼️ Overloading ◼️

1) when two or more methods in one class have same method then, overloading occurs.

2) Diffrent kinds of parameters are used.

3) All classes and strings are different



◼️ Overriding ◼️

1) Overriding occurs when there is only one method

2) Only one parameter is used

3) All classed the and strings are used.

▪️ Output of Overloading numbers is like this:

➡️ Sum of two numbers: 0

➡️Sum of three numbers: 0

➡️Sum of four numbers: 0

➡️Sum of five numbers: 0

▪️ Output of overriding numbers will be like this:

➡️ Speed Limit is: 150

▪️ I have taken the example of add numbers in this.
Similar questions