I have been trying to learn Java for the past week, and have been able to produce reasonable codes so far. However, I seem to have a problem in understanding the Java naming convention.
I just looked at a tutorial which says that class names should start with an upper case. If I look at the codes so far I have wrote, I have actually used lower case names, such as:
import java.io.*;
import java.util.*;
class orange implements Comparator {
public int mango(...) {
}
}
class jason {
public static void main(String args[]) throws java.io.IOException {
{
// Content here
}
}
}
As you can see, both my class names start with a lower case.
When I compile and execute the program, I don’t get any compile errors, and everything works as expected. I should have thought, since the class name starts with lower case, it would end up with a compile error: but this hasn’t happened. Why?
A good programmer must and will follow the naming conventions specified in any programming language for a neat and effective program.
Refer to this page for more Java naming conventions.