Is Dynamic Casting Possible in Java
- by Tom Tucker
So I have a class of overloaded methods like this:
class Foo {
public void test(Object value) {
...
}
public void test(String value) {
...
}
}
I need to pass a property value of a bean to one of these methods depending on its type, but I don't know the actual property type until the runtime. e.g.
public void…