What are the rules for naming variables in java?

Java

1 answer

Answer

1136336

2026-04-16 05:55

+ Follow

Some basic conventions are:
1. you cannot have keyWords as names
2. All identifiers have to start with an alphabet
3. Except '_' and '$' no other special character is allowed in names
4. When there are multiple Words in an identifier we usually capitalize the first alphabets of each Word. For example if an identifier represents name of employee then we name it as nameOfEmployee. The first Word would remain normal with no capitalization

etc...

ReportLike(0ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.