Possible Duplicate:
Java default constructor
I am working on Java practice questions and came across this :
Given:
class X {}
class Y {Y () {}}
class Z {z(int i ) {} }
Which class has a default constructor?
A. X only
B. Y only
C. Z only
D. X and Y
E. Y and Z
F. X and Z
G. X, Y and Z
I would say that the correct answer would be A, because class X is the only class without any explicitly defined constructor. My peer is saying that it would be G, because a what constitutes a default constructor is when you actually change values within the constructor body.
We've done some research and answers seem to differ when it comes to what a default constructor actually IS (at this level).
Can anyone provide an answer and logical explanation here? Thank you very much.