Ask Question
25 September, 17:02

C+ + programming true or false questions

1. We have a class called animalType. Answer the following questions about clas animalType.

a. Its constructors will be named animalType. (True or False)

b. Return type of its constructors will be void. (True or False)

+3
Answers (1)
  1. 25 September, 18:38
    0
    a. True

    b. False

    Explanation:

    Constructor is used to initialize the object of the class.

    Rules of constructor:

    1. Constructor name must same as the class name. it means, if the class name is animalType, then constructor name must be animalType.

    2. Constructor does not have any return type. it means, it does not return anythings.

    Therefore, part (a) is true, Constructor name must same as the class name.

    and part (b) is false, because constructor does not have any return type.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “C+ + programming true or false questions 1. We have a class called animalType. Answer the following questions about clas animalType. a. Its ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers