Table of Contents
Variables in Java
A variable in Java acts like a container or a box used to store information. It's essential for programs to store and manipulate data.

Variables reduce redundancy in code. Instead of repeating the same value across your program, you store it in a variable. This simplifies making changes since you only update the value in one place, reflecting everywhere the variable is used.
Naming Conventions: The Basics
- Naming conventions are critical for clarity, maintenance, and collaboration in programming.
- Rules include starting names with an underscore, dollar sign, lowercase, or uppercase letter. Following characters can include letters, underscores, dollar signs, and numbers.
- Names should not start with numbers, contain spaces, or special symbols except underscores and dollar signs.
- Reserved keywords like 'Class' and 'void' cannot be used as variable names.

CamelCase: The Preferred Style
- 'CamelCase' is a naming style where the first word starts with a lowercase letter and subsequent words start with uppercase letters, all concatenated. For example, 'sumOfNumbers'.
- This style enhances consistency, readability, and maintainability in code.
Importance of Naming Conventions
- They make code consistent and readable.
- They simplify code maintenance and collaboration among developers.
- Proper naming prevents confusion and errors, making the code more accessible for future reference and teamwork.