MYTUTOR SUBJECT ANSWERS

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

12 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

9 SUBJECT SPECIALISTS

£22 /hr

Matthew M.

Degree: MSci Computer Science (Masters) - Lancaster University

Subjects offered: Computing, Maths+ 3 more

Computing
Maths
Economics
Business Studies
-Personal Statements-

“About Matt: I'm Matt and I am a computer science student at Lancaster University. I have often been described as being friendly and hardworking by my friends, family and work colleagues. Prior to University I worked in the industry as...”

£20 /hr

Jose Ignacio M.

Degree: Electronics and Software Engineering (Masters) - Edinburgh University

Subjects offered: Computing, Spanish+ 2 more

Computing
Spanish
Physics
Maths

“About Me: I am a Spanish engineering student at The University of Edinburgh. Half way through my first year for an MEng degree on Electronics and Software Engineering. If you take a quick look at my grades you may think I have always ...”

MyTutor guarantee

£24 /hr

Lauren G.

Degree: Technology Enhanced Learning (Masters) - Durham University

Subjects offered: Computing, Physics+ 2 more

Computing
Physics
Maths
ICT

“Hello! I'm currently a Master's student studying Technology Enhanced Learning at Durham University. I completed my undergrad last year in Natural Sciences with Maths and Computer Science, also from Durham.  I am very passionate about ...”

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 the difference between simplex, half duplex and full duplex?

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

How do you convert from binary to decimal?

When data is transmitted over long distances, latency can become an issue. Explain what latency is.

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