For each of the following specify T if the statement is true

For each of the following, specify \"T\" if the statement is true or \"F\" if it is false. The destructor of a class cannot have any return type. A constructor of a class cannot have any return type. Private properties of a class can be accessed by both member functions and non-member functions Public properties of a class can be accessed by member functions but they cannot be accessed by non-member functions. In object oriented programming, object properties and the functions operating on these properties are defined within a class. Multiple objects can be constructed from each defined class. What does the following program write on the screen? #include using namespace std; void chears () {cout

Solution

Q1.

i) The destructor of a class cannot have any return type: True

ii) A constructor of a class cannot have any return type:True [Constructors have no return type, they are not inherited, and cannot be hidden or overridden by a subclass.]

iii) Private properties of a class can be accessed by both member functions and non-member functions: False

iv) Public properties of a class can be accessed member functions but they cannot be accessed by non-member functions: False

v) In Object Oriented Programming, object properties and the functions operating on these properties are defined within a class. Multiple objects can be constructed from each defined class.: True

Q2.

Output:
Chears is printed
Regards is printed
Chears is printed

 For each of the following, specify \

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site