Let's say I have the following ruby code :
def use_object(object)
puts object.some_method
end
and , this will work on any object that responds to some_method,right?
Assuming that the following java interface exists :
interface TestInterface {
public String some_method();
}
Am I right to presume that interfaces are java's way to achieving the same thing ( with the only difference that the parameter's type would be TestInterface ) ?