Skip to content
Sharp

Object-oriented programming · interview question

Which of the following describes a 'constructor' in Java?

Multiple choiceEasychapter-2-curatedpremiumoopobject-references
Choose one answer
Answer and explanation

Correct answer

D. A special method used to initialize objects.

Why

A constructor is a special method invoked when an object is created, initializing the new object.

Test yourself on Object-oriented programming

A free test with instant, explained results. No account needed.

Start free test
All Object-oriented programming questions →