MYTUTOR SUBJECT ANSWERS

207 views

What is method "Overloading" in object-oriented programming (OOP) ?

Method or function overloading allows a method with the same name to be declared more than once given that they have different input parameters.

For example, there is a method to calculate the area of shapes. There are different shapes such as circles and rectangles. In these two cases, if someone calls the function calculateArea, the result should be correct for the given shape, regardless of whether the shape is a circle or a rectangle. The declaration of this in a programming language in shown below:

Rectangle: calculateArea(double length, double width

Circle:  calculateArea(double radius)

A great advantage of method overloading is that it allows a programmer to use the function appropriately without having to know the inner-workings of that method. 

Argha S. GCSE Physics tutor, GCSE Maths tutor, GCSE Computing tutor, ...

9 months ago

Answered by Argha, an A Level Computing tutor with MyTutor

Still stuck? Get one-to-one help from a personally interviewed subject specialist

3 SUBJECT SPECIALISTS

£20 /hr

Christopher P.

Degree: Computer Science (Bachelors) - Warwick University

Subjects offered: Computing, Maths+ 1 more

Computing
Maths
History

“About me: I am a Computer Science student currently studying at Warwick University. I've always had a passion throughout my education for Maths and Computing, as the vast array of ideas that you can bring to life through programming i...”

MyTutor guarantee

£20 /hr

Michael T.

Degree: MMath (Masters) - Durham University

Subjects offered: Computing, Physics+ 1 more

Computing
Physics
Maths

“About Me: I am currently studying Mathematics at Durham University. Maths can sometimes be intimidating, but it's that which makes it so rewarding when it all starts to make sense. I have been teaching in one form or another since 13...”

£20 /hr

Kyle C.

Degree: Computer Science With Electronics (Bachelors) - Edinburgh University

Subjects offered: Computing, Physics+ 1 more

Computing
Physics
Maths

“Who am I?I am a student pursuing a Computer Science degree at the University of Edinburgh. I enjoy working on theatre lighting and am also a keen fencer which is where I initially started teaching by coaching younger fencers.Sessio...”

About the author

£20 /hr

Argha S.

Degree: Computer Systems (Bachelors) - Warwick University

Subjects offered: Computing, Physics+ 1 more

Computing
Physics
Maths

“Top tutor from the renowned Russell university group, ready to help you improve your grades.”

MyTutor guarantee

You may also like...

Other A Level Computing questions

What is 55 using 8-bit unsigned binary?

What is method "Overloading" in object-oriented programming (OOP) ?

What is the difference between an array and an ArrayList in Java?

Explain how the even parity system works when transmitting ASCII codes. Include a description of the roles of the sending device and the receiving device during transmission.

View A Level Computing tutors

Cookies:

We use cookies to improve our service. By continuing to use this website, we'll assume that you're OK with this. Dismiss

mtw:mercury1:status:ok