Which of the following is incorrect?
a. A constructor may be static.
b. A constructor may be private.
c. A constructor may invoke a static method.
d. A constructor may invoke an overloaded constructor.
e. A constructor invokes its superclass no-arg constructor by default if a constructor does not invoke an overloaded constructor or its superclass’s constructor.
a. A constructor may be static.
A constructor cannot be static, because you use a constructor to create a specific instance. A constructor may be private. In this case, the use cannot create an instance using this constructor. For example, the constructor in the Math class is private. A constructor may invoke a static method just like any method can invoke a static method. A constructor can invoke an overloaded constructor using the this keyword. So, the correct answer is A.
You might also like to view...
Why is segmentation recommended for network design? That is, what makes it better to have a separate network segment for web servers, one for the back-end office processing, one for testing new code, and one for system management?
What will be an ideal response?
MC All data items processed by computers are reduced to combinations of__________ and__________ .
a) ones, twos. b) zeros, ones. c) zeros, twos. d) None of the above.