Answer the following questions true (T) or false (F)
1. You can write a class that is useful with all its constructors in the private section.
2. A constructor can be called implicitly or explicitly. (Implicitly means the compiler did it for you.) In the interest of uniformity in answers, please use class A; for your examples.
1. False
Explanation: Apart from friend of the class (something you will see later in this course) a class with all private constructors cannot create an object of the class. It seems useless to have a class for which you can have no objects..
2. True
Explanation: A constructor can be implicitly called with the declaration A x;. The default constructor is called explicitly with syntax is A x = A();
If the declaration is A x(2), the constructor is called implicilty. The equvalent explicit constructor call is A x = A(2); and so on.
You might also like to view...
A set of instructions in Visual Basic for Applicaitons that accomplishes a specific task is called a(n) ________
Fill in the blank(s) with correct word
The Kinko's computer used by Zacharias Moussaoui was not seized by the FBI because agents were informed that data on the computer was scrubbed
Indicate whether the statement is true or false.