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 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.

Computer Science & Information Technology

You might also like to view...

Which of the following PHP functions is a synonym of highlight_file()?

a. show_source() b. pack() c. highlight_script() d. highlight_string()

Computer Science & Information Technology

Press the Keyboard shortcut ____ to go to the beginning of the next word.

A. Right arrow B. Left arrow C. Ctrl+left arrow D. Ctrl+right arrow

Computer Science & Information Technology

Which type of algorithm is used when two different keys are used in encryption?

A. symmetric-key B. PKI C. keyless D. asymmetric-key

Computer Science & Information Technology

Which statement pertaining to system reliability is not true?

A. Having the latest version of software products can make your system more reliable. B. An accumulation of temporary Internet files has no effect on your computer's overall performance. C. Removing unnecessary programs from your Startup folder can improve system reliability. D. When you defrag your hard drive, it works more efficiently.

Computer Science & Information Technology