Question

True and False questions on C++ classes 1. C++ classes have a constructor that has the...

True and False questions on C++ classes

1. C++ classes have a constructor that has the same name as the class.

2. C++ constructors are called automatically.

3. You must write code for the C++ constructor of every class you write.

4. Methods of a C++ class can create or add additional instance variables to the class.

5. Methods may be declared in the private section of the class definition.

6. Instance variables must be declared in the private section of the class definition.

7. A compiler error is generated if a method has a variable with the same name as an instance variable.

8. Methods may be written inline in the header file.

0 0
Add a comment Improve this question Transcribed image text
Answer #1
1.
C++ classes have a constructor that has the same name as the class.
True

2.
C++ constructors are called automatically.
True

3.
Constructor generates default constructor.
False


4.
Methods of a C++ class can create or add additional local variables to the class.
False

5.
Methods may be declared in the private section of the class definition.
True

6. 
Instance variables may declared in public section also.
False

7. 
A compiler error won't is generated if a method has a variable with the same name as an instance variable.
False

8. 
Methods may be written inline in the header file.
True
Add a comment
Know the answer?
Add Answer to:
True and False questions on C++ classes 1. C++ classes have a constructor that has the...
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. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT