I'm writing a Java application, and have a question. How can I implement a function with one parameter which should require an argument which implements multiple interfaces? For example:
interface Father
{
}
interface Teacher
{
}
public void foo(FatherAndTeacher person) // How do I do this?
{
// Do something
}
I know I can use two parameters, such as:
public void foo(Father person1, Teacher person2)
{
// Do something
}
but I think maybe having a single parameter which implements both interfaces would be better.