package
com.javaeasy;
class
A {
public
void
add() {
System.out.println("I
am in class A");
}
}
class
B extends
A {
public
void
add() {
System.out.println("I
am in class B");
}
}
public
class
NotSupportingMultipleInheritance extends
A,B {
//Confusion
seen here and cant decide to call class A or B method
//Diamond
Problem
public
static
void
main(String[] args) {
//
TODO
Auto-generated method stub
NotSupportingMultipleInheritance
obj=new
NotSupportingMultipleInheritance();
obj.add();
}
}
java programming example codes
ReplyDeletejava network - Ping a server