🎴 Flashcard Mode
Java Programming Language Quiz
Card1 / 20
Mastered0
Review0
QuestionClick to flip
Which of the following are true about Constructors?
AnswerClick to flip back
A
Member Function
B
Same name as Class name
C
Default constructor initializes all non-initialized fields and variables to zero.
D
Compiler adds an empty constructor, if we do not write our own constructor
💡 Explanation:
Constructors ARE member functions (A), MUST have the same name as the class (B), the default constructor initializes numeric fields to zero (C), and the compiler DOES provide an empty default constructor if you don't write one (D). All four statements are correct.