Skip to main content

Rules for naming convention of a variable :

1. First letter of a variable name cannot be a digit.

Example
5id  ✖
id5  
i5d  

2. Special characters are not allowed within the variable name except an underscore _
Example:
rollno.   ✖    //full stop is not allowed
roll no   ✖   //space is not allowed
_rollno  

3. Keywords are not allowed within the variable name
Example
void  


     

Comments