I wonder what considerations I should make, when I have to decide whether to take an interface or a class to place my static helper method in.
Concrete example: I want to provide a little method, that I can call from the main method in Swing components, so I can faster iterate the development on them.
Should I place it in an interface or in a class?
public final class SwingDevHelper {
public static void startSwingContainer(Container container) {
...
}
}
public interface SwingDevHelper {
static void startSwingContainer(Container container) {
...
}
}
Do I have to consider semantical or technical points, e.g. performance or visibility?
If this question is raised then this method does not belong to an interface ('interface' in broad meaning, not just Java). So it is always better to put it as low as possible. In other words, if it is possible -- keep it in a class, and move to interface only essential members.