I code in Python a lot, and I frequently create classes. Now, I'm not sure if this is good Python form, but I just declare a class in the same file as my main().
class foo {
...
}
I'm wondering if it's good form in Java to do the same?
For example,
class foo {
public static int name;
public static int numPoints;
public static int[] points;
}
public class bar {
public static void main(String[] args) {
...
}
}
Does not throw errors in Eclipse, so it must be allowed. But is it okay to do? Would it be better to just declare this class in a separate file..?
Edit: I just want to emphasize that my new class literally is just a container to hold the same type of data multiple times, and literally will only have like 3 values. So it's total about 5 lines of code. The question is - does this merit a new file?