I have several subclasses to go along with my main class. Is it bad practice to add a main function to every single class for tests?
Is it bad practice to add a main function to every single class for tests?
Yes, for various reasons:
Typically, I use a separate Eclipse project in the same package (for access to package-restricted members), using JUnit or something similar.
See more on this question at Stackoverflow