

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- 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 Questions & Answers
- 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
- CamelCase in Java naming conventions
- Naming a thread in Java
- Advantages of naming conventions in Java
- What are the rules for a local variable in lambda expression in Java?
- Explain naming conventions for packages in java?
- Explain variable declaration and rules of variables in C language
- Rules for Java method overriding
- Naming Conventions in C#
- Why we should follow the naming conventions in Java?
- java variable declaration
Advertisements