Class conventions

Oracle Certified Foundations Associate Java Certification Questions and Discussion
1Z0-811

Moderator: admin

Post Reply
aks0961
Posts: 12
Joined: Sun May 28, 2023 1:17 pm
Contact:

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.

admin
Site Admin
Posts: 10036
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

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 11 guests