Question: Given this code defining a class (shown with line numbers): 1: class newClass { 2: private: 3: int a; 4: public: 5: void setA(int value)

Given this code defining a class (shown with line numbers):

1: class newClass { 2: private: 3: int a; 4: public: 5: void setA(int value) { a = value; } 6: int getA() { return a; } 7: newClass(int value) : a(value) {}; 8: }; The code on line 7 is referred to as what?

A data member

A constructor

A destructor

An initializer

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!