java - Is it not necessary to implement get method in class B ? Why compiler not enforcing ? Any concepts I missed? -
interface a{ public void get(); public void set(); } abstract class abstracta implements a{ @override public void get(){ system.out.println("in funciton"); } abstract public void set(); } class b extends abstracta implements a{ @override public void set(){ system.out.println("in set method"); } }
is not necessary implement method in class b?
is because abstracta implemented same method ?
is multiple inheritance ?
is not necessary implement method in class b?
no, since abstracta
implements , b
extends abstracta
.
is because abstracta implemented same method ?
yes. , because b
extends abstracta
. both required work.
is multiple inheritance ?
no, not. b
still inheriting 1 class - abstracta
.
Comments
Post a Comment