Answer to Question #8429 in C++ for Cheryl

Question #8429
is having two methods in a class permissible? why?
explain the purpose of a constructor and the implication of having two in one class.
Expert's answer
Methods may be several. The method in object-oriented programming - it is a function or procedure, belonging to any class or object. In object-oriented programming class constructor - a special block of instructions is called when an object is created. The constructor method is similar to but different from the method that does not explicitly defined the return type is not inherited, and usually has different rules for consideration of modifiers. Constructors are often distinguished by having the same name as the class name, which is declared. Their task - to initialize the members of the object

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!


No comments. Be the first!

Leave a comment

Ask Your question

New on Blog