How do i pass a class type into a function

As I said, pass in a Class object (which you can get from eg. Foo.class) and replace instanceof with a call to cls.isInstance(..).

1 Like