You need to change all the method parameters types to Object.
public void myMethod(Object o){
// ...
}
Please note that in order to access o
as a certain type of other class you will need to first test if it is in fact that class with if(o instanceof OtherClass)
and then cast it with OtherClass o2=(OtherClass) o
. Casting is expensive (hogs a lot of CPU (for a simple operation)) though so avoid if possible. If you just need a string representation of o
then just call o.toString()
.