I have a question about how to name a class in java. Could a class name be arbitrary or have to obey some rules? For example, I want to define linked lists in a class, does the class name have to be "ListNode" in order to ensure it is a recursive data type?
The compiler does not understand English.
To the compiler,
Bla1234567 are equally good names for a class that represents an element in a linked list.
When naming your classes (and functions, methods and variables), you should mostly consider your fellow humans that have to read the code (including yourself in a few months). They will have to be able to understand that the name stands for with the least amount of effort.
There are no compulsory rules with naming in java, however there are few conventions you should follow in java : http://www.iwombat.com/standards/JavaStyleGuide.html#Class%20and%20Interface%20Names