I am currently learning JUnit. I came across two ways of passing multiple classes into runClasses method, ie. with @SuitClasses annotation and with an Array of classes.
@RunWith(Suite.class)
@SuiteClasses({MyClass1.class,MyClass2.class})
public class MySuiteClass {}
...
Result result = JUnitCore.runClasses(MySuiteClass.class);
Class<?>[] carr = {MyClass1.class,MyClass2.class};
Result result = JUnitCore.runClasses(carr);
Is there any difference between both methods and when should I be using either of them?