PrepAway - Latest Free Exam Questions & Answers

You need to create a method that can be called by using a varying number of parameters

You need to create a method that can be called by using a varying number of parameters.
What should you use?

PrepAway - Latest Free Exam Questions & Answers

A.
method overloading

B.
interface

C.
named parameters

D.
lambda expressions

Explanation:
Member overloading means creating two or more members on the same type that differ only
in the number or type of parameters but have the same name.
Overloading is one of the most important techniques for improving usability, productivity, and
readability of reusable libraries. Overloading on the number of parameters makes it possible
to provide simpler versions of constructors and methods. Overloading on the parameter type
makes it possible to use the same member name for members performing identical
operations on a selected set of different types.

One Comment on “You need to create a method that can be called by using a varying number of parameters


Leave a Reply