I need to store a reference to a class in a variable, such that I can call the static methods of that class on the variable.
Main.java
public class Main {
private static SomeClass cls;
private static void main(String[] args) {
**cls = SomeClass;**
cls.doSomething();
}
SomeClass.java
public class SomeClass() {
public static doSomething() {
}
}
cls = SomeClass is not working here, but I also don't want to instantiate SomeClass.
Can anyone help?