Chương trình đúng hay sai?interface A {public void aMethod();}interface B {public void bMethod();}interface C extends A,B {public void cMethod();}doneTrueFalse
Question
Chương trình đúng hay sai?interface A {public void aMethod();}interface B {public void bMethod();}interface C extends A,B {public void cMethod();}doneTrueFalse
Solution
Đúng. Trong Java, một interface có thể kế thừa từ nhiều interfaces khác bằng từ khóa extends. Vì vậy, interface C có thể kế thừa từ cả A và B.
Similar Questions
Chương trình đúng hay sai ?interface A {public void aMethod();}class B implements A{@Overridepublic void aMethod() {}}class C extends B implements A{}
ect the correct answerWhich of the following is the correct way of implementing an interface A by class B?
interface AC { public void onAC(); public void offAC();}interface Camera { public boolean reverseGearStatus();}interface Bluetooth { public void receiveCall(); public void makeCall();}interface Car , , { //Functions of car}public class FordCar Car{ //Implementation of all abstract methods //in AC, Camera, Bluetooth and Car}
Select the correct answerWhich of the following is the correct way of implementing an interface A by class B?Optionsclass B extends A{}class B imports A{}None of the mentionedclass B implements A{}
In Java programming, the keyword used to implement an interface in a class is:Question 4Answera.usesb.extendsc.requiresd.implements
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.