-
A difficult question
Can anyone help me with this? THANK YOU VERY MUCH!
If the java file name is ABC.java.
Why are some classes defined before the public class ABC?
e.g.
class sparse_binary_vector
{
Vector id = new Vector();
}
class sparse_vector
{
Vector id = new Vector();
Vector val = new Vector();
}
public class ABC
{
...
}
-
You can define more than one class in a single source file but only one of them can be public, the other classes have to have package scope. More than one class per source file suggests a tight coupling of the non-public classes with the single public class. It can be abused though.
kind regards,
Jos
-