hi,
im sorry, i have no clue bout this problem...so dont know which category it belongs to, so taking the safe route out and posting it in begginer's category, cos thats who i am. i have this basic problem with interfaces. i have been stuck for a while. i Have two interfaces A and B declaring the same function prototype get(). a class C implements these two interfaces and defines get(). Now in the main function when i call a.get() (a is an object of A) or b.get() (where b is an object of B)...is there any way to find out which interface called the function?..chk out the code below to understand my problem better.
interface A {
void get();
}
interface B {
void get();
}
class C implements A,B {
public void get(){
System.out.println("Hello");
}
}
public class inter {
public static void main(
String[] args) {
C c = new C();
A a;
B b;
a = c;
a.get();//At this point
b = c;
b.get();//And at this point
}
}