← Back to Week 1 Hub
Java Naming Conventions
Workbook 1c, p.53 — The rules every Java developer follows
abc
Variables & Methods
camelCase
- studentName
- totalPrice
- calculateTax()
- isActive
Abc
Classes
PascalCase
- MathApp
- BankAccount
- StudentRecord
- Main
a.b.c
Packages
all.lowercase
- com.pluralsight
- com.pluralsight.myapp
- org.example.utils
- com.company.project
A_B
Constants
UPPER_SNAKE_CASE
- MAX_SIZE
- TAX_RATE
- PI
- DEFAULT_COLOR
Variable
✗ FirstName
✓ firstName
Class
✗ bankAccount
✓ BankAccount
Method
✗ GetTotal()
✓ getTotal()
Package
✗ Com.MyApp
✓ com.myapp
Constant
✗ maxSize
✓ MAX_SIZE
Variable
✗ student_age
✓ studentAge
Tip: Java compiles fine with "wrong" naming — these are conventions, not compiler rules.
But every professional Java developer follows them. Code that breaks naming conventions looks
immediately wrong to experienced developers and will be flagged in any code review.
Click an answer in the quiz to check your knowledge