MYTUTOR SUBJECT ANSWERS

1074 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, ...

2 years ago

Answered by Argha, an A Level Computing tutor with MyTutor


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

14 SUBJECT SPECIALISTS

£26 /hr

Michelangelo M.

Degree: MMath Mathematics with Placement (Masters) - Bath University

Subjects offered:Computing, Maths+ 4 more

Computing
Maths
Italian
Further Mathematics
.STEP.
.MAT.

“Mathematics student at the University of Bath, willing to help you love this subject and improve your grades.”

£20 /hr

Kajetan C.

Degree: Computer Science (Integrated Masters) - Southampton University

Subjects offered:Computing, Physics+ 3 more

Computing
Physics
Maths
Further Mathematics
-Personal Statements-

“UK Top 50 AQA A2 Computer Science graduate, providing tailored interactive sessions to improve your understanding of Maths, Physics and Computing.”

MyTutor guarantee

£20 /hr

Nathan H.

Degree: Computer Science (including a year in industry) (Masters) - Warwick University

Subjects offered:Computing, Physics+ 3 more

Computing
Physics
Maths
Further Mathematics
-Personal Statements-

“A Passionate Computer Scientist, With A Love For Maths And Physics. Ready To Help You Ace Your Exams!”

MyTutor guarantee

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 Reverse Polish Notation?

How to represent a negative decimal number using 8-bit binary two's complement ?

Some problems are intractable. What does it mean for a problem to be described as intractable?

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

View A Level Computing tutors

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

mtw:mercury1:status:ok