- 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 declaration best practices
Following are the best practices while declaring a variable.
Variables names should be short or long enough as per the scope. For example, loop counter variable, i is fine whereas employee as a loop variable.
Specific words should not be used as equals, compare, data.
Use meaningful names which can explain the purpose of the variable. For example cnt Vs counter.
Don't use _ to declare a variable name, Use camel casing. For example, employeeName is better than employee_name.
Each organization has its own syntax specific standards. Follow those rules to maintain consistency and readability.
- Related Articles
- java variable declaration
- Best practices for Java comments.
- Openssh security best practices
- Acquiring Resources – Best Practices!
- VMware vSphere Best Practices
- Nginx WebServer Best Security Practices
- C# Exception Handling Best Practices
- Best practices for using MySQL indexes?
- Best practices for writing a Dockerfile
- Problem Solving - Steps, Techniques, & Best Practices
- Best Practices for Project Budget Management
- What are Python coding standards/best practices?
- Selenium Web Test Automation Framework Best Practices.
- Patch Management: Definition, Working, Need, Best Practices
- Best Practices for Managing the Security Function

Advertisements