java - Initializing the base class of an extended class -
suppose there 3 classes a
, b
, c
:
public class { int op1; // op operand int op2; int op3; public a(int op1, int op2, int op3) { this.op1 = op1; this.op2 = op2; this.op3 = op3; } public a(a a) { // valid? = a; } } public class b extends { public b(int op1, int op2, int op3) { super(op1,op2,op3); } } public class c extends { private arraylist<integer> array; public c(b b) { // can base class initialized without // calling constructor initializes each // attribute individually? super(b); array = new arraylist<integer>(); } }
is possible invoke base constructor using object received parameter in class c's constructor?
Comments
Post a Comment