Question

What is the difference between the default constructor, the no argument constructor, and other constructors like...

What is the difference between the default constructor, the no argument constructor, and other constructors like a 2 parameter constructor?

Homework Answers

Answer #1
No argument constructor is the constructor of the class which takes no arguments/parameters into the function.
If you don't write any constructor in the class, then the compiler creates a default no argument constructor for you.
this constructor provided by the compiler is called a default constructor.

difference is that we can write no argument constructor in class by ourself. where as compiler provided the default constructor.

And we can also write constructors with more than one argument for example 2.
Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
What is the difference between methods and constructors?
What is the difference between methods and constructors?
For this question you will write two (2) constructors in the implementation file: CylinderType.cpp (Assume that...
For this question you will write two (2) constructors in the implementation file: CylinderType.cpp (Assume that the base class CircleType has a default constructor & assigns 1.0 to its private double radius) part (a) // The first constructor is a default constructor. Please use height as the CylinderType's private member name in the body. // It will create a CylinderType object with a radius of 1.0 and height of 1.0 part (b)    // The second constructor should have two...
What is the difference between brainwashing and an argument? What does it mean to dispute an...
What is the difference between brainwashing and an argument? What does it mean to dispute an argument on the basis of the facts? What does it mean to dispute an argument on the basis of the values? What does it mean to dispute an argument on the basis of the reasoning?
Compare the difference between default risk of interest swap and default risk of currency swap. Which...
Compare the difference between default risk of interest swap and default risk of currency swap. Which one is larger? Justify your answer.
(1) What is the difference between cogency and strength in an inductive argument? My Answer: (2)...
(1) What is the difference between cogency and strength in an inductive argument? My Answer: (2) What is a weak inductive argument? What is the analogue of weakness in deductive augments? My Answer: (3) What is the deductive analogue of inductive strength, and how does it differ from the deductive analogue My Answer:
What is the difference between an indicative price like LIBOR and a transaction price like the...
What is the difference between an indicative price like LIBOR and a transaction price like the S&P 500 and why is it important?
What is the difference between an indicative price like LIBOR and a transaction price like the...
What is the difference between an indicative price like LIBOR and a transaction price like the S&P 500 and why is it important?
Discuss the difference between Credit Default Swap and Total Return Swap in terms of hedging credit...
Discuss the difference between Credit Default Swap and Total Return Swap in terms of hedging credit risk and market risk
Program C++ (use visual studio) Q1. What default copy constructor does the compiler insert in the...
Program C++ (use visual studio) Q1. What default copy constructor does the compiler insert in the following class? class Student { string name; string id; double grade; }; =========================== Q2 .What is the factor transfer method used when the f() function is called from? void f(int n[]); int main() { int m[3]= {1, 2, 3}; f(m); } ================================== Q3. Write a program that produces a bigger() with a prototype as shown below and outputs a large value by inputting two...
What is the different between an inductive argument and deductive argument? Give an example.
What is the different between an inductive argument and deductive argument? Give an example.
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT