I have a use case of this kind
interface i {
void method1();
void method2();
}
class A implements i {
void method1() {
System.out.println("Method1 A ..");
}
void method2() {
System.out.println("Method2 A ..");
}
}
class B implements i {
void method1() {
System.out.println("Method1 B ..");
}
//Assume : B does not know how to implement method2
//void method2() {
//}
}
I know class B can be abstract and not implement method2 for interface i. Is the general practice that if I don't want my class B to be abstract to throw exception from method2 if it does not have any implementation for method2.