Class conventions

Oracle Certified Foundations Associate Java Certification Questions and Discussion

Moderator: admin

Post Reply
Posts: 9
Joined: Sun May 28, 2023 1:17 pm

Class conventions

Post 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.

Site Admin
Posts: 9892
Joined: Fri Sep 10, 2010 9:26 pm

Re: Class conventions

Post 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.
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests