Is there any way to pass class as a parameter in Java and fire some methods from that class?
void main() { callClass(that.class) } void callClass(???? c
Use
void callClass(Class classObject) { //do something with class }
A Class is also a Java object, so you can refer to it by using its type.
Class
Read more about it from official documentation.