Is there a way to run a java class (which doesnt have a main method) and access its object, methods etc from the command line?
posted 7 years ago
Yes, but you'll have to create a class that has a main method, and then in the main method create an object of the class of interest. When I do this, I often have the word "Test" in my small main method containing class. So if my original class is called Fubar, the testing class will be FubarTest or some such.