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

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
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

Post by answerhappygod »

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;
}
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply