public class a implements b,c {
public void g()
{
}
public static void main(String[] args){
a object =new a(); //this overrides for both the methods in
// the interfaces b and c
object.g();
}
}
interface b
{
void g();
}
interface c
{
void g();
}
Here I want to provide different implementations for the two interfaces . How do I do it. In c# you can explicitly specify the overridden method is meant for which interface.Can i do that in java.If not please specify a workaround this problem with a simple example.
What I want can be stated like this... supposing the interfaces are meant for one TV remote(interface b) and a internal VCD player remote (interface c)...and when I am implementing the features of both in one remote (class a in this case)I want to provide different implementation for the TV and the VCD for the same button clicked on the remote(method g() in this case). When I override g() it gets overridden for both the interfaces.How do I explicitly mention which interface it is meant for. I want to provide different implementation(by overriding g()) for TV and VCD player.
E.X. the right direction button will work as channel change for TV but the same button will work as skip button for VCD