Page 1 of 1

Class conventions

Posted: Wed May 31, 2023 12:52 pm
by aks0961
Under section 4.1.2,Conventions in Java, it states that class names such as "Readonlyarraylist" is an incorrect way to declare a class name as it does not follow camel case convention

However, when typing

class Readonlyarraylist{} into eclipse, there is no issues being shown. Just wanted to get some clarity on this matter.

Re: Class conventions

Posted: Wed May 31, 2023 9:28 pm
by admin
It is a convention, not a rule. Conventions are meant for human readability of the code and not for the compiler. Compiler doesn't care how you name your classes or variables.