No products in the cart.

Differnce b/w function overloading and default …

CBSE, JEE, NEET, CUET

CBSE, JEE, NEET, CUET

Question Bank, Mock Tests, Exam Papers

NCERT Solutions, Sample Papers, Notes, Videos

Differnce b/w function overloading and default arguments???
  • 1 answers

Yogita Ingle 5 years, 5 months ago

  • If two or more functions are given the same name but different no/type of arguments then it is called as function overloading. One thing to keep in mind is that functions are not differentiated on the basis of their return type, they are known distinct to compiler only if they have different no/type of arguments.
  • It means functions having same name and same no and type of arguments but with different return type generate error.
  • However default arguments are the arguments for which if no value is passed in function call, they use some default value provided by the programmer already.
  • Though these default arguments can be avoided if some value is passed while function call, they are easier if some constant value is to be passed repeatedly and change in the value is very less frequent.
http://mycbseguide.com/examin8/

Related Questions

What are called tokens
  • 2 answers

myCBSEguide App

myCBSEguide

Trusted by 1 Crore+ Students

Test Generator

Test Generator

Create papers online. It's FREE.

CUET Mock Tests

CUET Mock Tests

75,000+ questions to practice only on myCBSEguide app

Download myCBSEguide App