Computer Science, asked by Anonymous, 1 year ago

hey mates......❤

annyeong☺❤☺❤☺

what is the difference between parameterized Constructor and Default constructor ( points must be varied) *_*​


krithi2001143: r u bts army????
Anonymous: naah.. but i luv to say hello as annyeong☺♥️
krithi2001143: ohhh
Anonymous: yupe sweetu..☺

Answers

Answered by Anonymous
8

Default constructor:

================

A constructor which takes no arguments is known as default constructor.

__________

●Compiler inserts a default no-arg constructor after compilation, if there is no explicit constructor defined in class and its datamember is initialise with 0.

●No need to pass any parameters while constructing new objects using default constructor.

●Default constructor is used for initializing objects with same data.

Parametrized constructor:

====================

●A constructor which takes one or more arguments is known as parameterized constructor.

●When parametrized constructor is defined in class, then programmer needs to define default no-arg constructor explicitly if required.

●At least one or more parameters needs to be passed while constructing new objects using argument constructors.

●Whereas parametrized constructor is used to create distinct objects with different data.

================☆☆☆☆☆☆☆☆☆☆☆====================


Anonymous: thanku sweetu❤❤☺
Similar questions