Need Assistance?

support@tutorialshub.in

Variables, Data Types & Operators

Variables & Naming Conventions in Java

ADVERTISEMENT
Java Free Lesson
5 min read
ADVERTISEMENT

In Java, every variable must be declared with a data type before it is used. Java supports three kinds of variables: Local variables (inside methods), Instance variables (inside a class, per object), and Static variables (shared across all objects of a class).

Java Naming Standards

  • Use camelCase for variables and methods (e.g., studentAge, calculateTax()).
  • Use PascalCase for class names (e.g., BankAccount).
  • Use UPPER_SNAKE_CASE with final for constants (e.g., MAX_USERS).
ADVERTISEMENT
Hi, I'm Tuby! Here to help you