Skip to main content

Command Palette

Search for a command to run...

What is constructor overloading ?

Published
1 min read
S

I love learning about technology and sharing that with others

  1. What is constructor overloading ?

    1. Constructor in a class with same name but different arguments

    2. And when we are creating object a particular constructor will be used that will be decided by the compiler

    3. Overloading takes place during compile time -> so when we are compiling that time only it is decided which method will be called.

    4. Give an example of Merchant in this case

      1. Means creating an object of merchant with parent

      2. Creating an object of merchant without parent

More from this blog

H

hashcodehub

271 posts

Consistent, Passionate and Organized :)