class A {
private int x;
private int y;
public A(int x, int y) {
this.x = x;
this.y = y;
}
}
Class B is a subclass of A. Which of the following can be constructors in B?
I:
public B() {
}
II:
public B(int x, int y) {
super(x, y);
}
III:
public B() {
super(0, 0);
}
IV:
public B(int x, int y) {
this.x = x;
this.y = y;
}
class A { private int x; private int y; public A(int x, int y) { this.x = x; this.y = y; } } Class B is a sub
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
class A { private int x; private int y; public A(int x, int y) { this.x = x; this.y = y; } } Class B is a sub
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!