Playing Compiler—Constructors
Explain why the following classes do not compile.
public class Mama { protected int x; public Mama() { x = 0; } public Mama(int y) { x = y; } } public class Son extends Mama { public Son() { } public static void main(String[] args) { Son s = new Son(2); } }
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.