Q.- Given the code fragment:-
class A1 {
public int a;
A1 (int a} {
this.a = a;
}
}
class A2 extends A1 {
int a;
A2 (int a , int b} {
/* Insert code here */
}
}
Which code fragment can be inserted?
A) super(a);
this.a =b;
B) super.a = a;
this.a = b;
C) super.a = b;
a = b;
D) this.a = b;
super (a);
⧪ please give your answer in a comment section.
class A1 {
public int a;
A1 (int a} {
this.a = a;
}
}
class A2 extends A1 {
int a;
A2 (int a , int b} {
/* Insert code here */
}
}
Which code fragment can be inserted?
A) super(a);
this.a =b;
B) super.a = a;
this.a = b;
C) super.a = b;
a = b;
D) this.a = b;
super (a);
⧪ please give your answer in a comment section.
1 Comments
A
ReplyDelete