- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Java variable naming rules
All Java components require names. Names used for classes, variables, and methods are called identifiers. In Java, there are several points to remember about identifiers. They are as follows -
Step 1 − All identifiers should begin with a letter (A to Z or a to z), currency character ($) or an underscore (_).
Step 2 − After the first character, identifiers can have any combination of characters.
Step 3 − A keyword cannot be used as an identifier.
Step 4 − Most importantly, identifiers are case sensitive.
Step 5 − Examples of legal identifiers: age, $salary, _value, __1_value.
Step 6 − Examples of illegal identifiers: 123abc, -salary.
- Related Articles
- variable naming conventions of java
- Best practice for variable and method naming in Java
- What are the rules for naming classes in C#?
- What are Variable Naming Conventions in JavaScript
- Java Naming conventions
- Naming a thread in Java
- CamelCase in Java naming conventions
- What are the rules for a local variable in lambda expression in Java?
- Advantages of naming conventions in Java
- Explain naming conventions for packages in java?
- Explain variable declaration and rules of variables in C language
- Rules for Java method overriding
- \nWhy we should follow the naming conventions in Java?\n
- Naming Conventions in C#
- java variable declaration

Advertisements