Java Identifiers โ Rules, Naming Conventions & Best Practices
Everything you need to know about Java identifiers โ naming rules, valid vs invalid examples, camelCase, PascalCase, SCREAMING_SNAKE_CASE, Unicode support, anti-patterns, and real-world production code conventions.
Last Updated
March 2026
Read Time
20 min
Level
Beginner
Chapter
6 of 35
What is a Java Identifier?
An identifier in Java is the user-defined name given to any program element โ a variable, method, class, interface, package, enum, annotation, or label. Every name you choose as a programmer is an identifier. When you write int age = 25;, the word age is an identifier. When you write class BankAccount, the word BankAccount is an identifier.
Identifiers are fundamental to code readability and maintainability. A well-named identifier makes code self-documenting โ meaning the name alone explains what the variable stores, what the method does, or what the class represents. A poorly named identifier forces every reader to mentally decode its purpose, adding cognitive load and slowing down development.
Java identifiers are governed by two distinct sets of rules: compiler-enforced syntax rules (which produce compile errors if violated) and community naming conventions (which produce bad code reviews and unreadable code if violated). Both matter in professional development.
Rules for Valid Java Identifiers โ The 6 Laws
The Java Language Specification (JLS ยง3.8) defines precise rules for identifiers. The Java compiler enforces all 6 rules strictly โ violation results in a compile-time error, not a warning.
An identifier can contain only: Unicode letters (AโZ, aโz, and letters from any language), digits (0โ9), underscore (_), and dollar sign ($). No spaces, hyphens (-), dots (.), @, #, !, or any other special characters are allowed anywhere in an identifier.
The first character must be a Unicode letter, underscore (_), or dollar sign ($). It CANNOT be a digit (0โ9). This rule exists so the compiler can instantly distinguish identifiers from numeric literals while parsing source code.
An identifier cannot be any of Java's 67 reserved keywords (class, public, int, static, etc.). Even unused keywords like 'goto' and 'const' are forbidden. Attempting to use a keyword as an identifier produces a compile-time syntax error.
Even though 'true', 'false', and 'null' are technically literals (not keywords), they are reserved and cannot be used as identifiers. This is a classic exam trap โ many students assume only keywords are forbidden.
Java identifiers are strictly case-sensitive. 'count', 'Count', 'COUNT', and 'cOuNt' are four completely different identifiers from the compiler's perspective. The compiler does not warn about case-similar names โ it silently allows them as distinct symbols.
The Java Language Specification sets no maximum length for identifiers. The practical limit is 65,535 characters (due to constant pool entry size in the class file format), which is effectively unlimited. Minimum length is 1 character.
Valid vs Invalid Java Identifiers โ 40 Examples
The best way to internalize identifier rules is through examples. Study this comprehensive table โ each invalid example includes the exact reason for rejection.
Identifier vs Keyword vs Literal โ The Critical Triangle
Beginners frequently confuse identifiers, keywords, and literals. This distinction is one of the most tested concepts in Java certification exams (OCPJP/OCA) and technical interviews. Understanding it precisely separates good Java programmers from great ones.
public class Triangle {
// โ keyword โ identifier
private int sides;
// โ keyword โ keyword โ identifier
public Triangle() {
// โ keyword โ identifier (constructor = class name)
this.sides = 3;
// โ literal (integer literal '3')
}
public boolean isValid() {
// โ keyword โ keyword โ identifier (method name)
return true;
// โ keyword โ boolean literal (NOT a keyword!)
}
public String describe() {
// โ identifier (String is a class, not a keyword)
return "I am a triangle";
// โ String literal
}
}Java Naming Conventions โ The Professional Standard
Java naming conventions are defined by Oracle's official Code Conventions for Java (first published 1999, widely adopted industry-wide) and reinforced by tools like Checkstyle, SpotBugs, and SonarQube. They are not enforced by the compiler โ but violating them is considered unprofessional code in any serious codebase or code review.
The golden rule: naming conventions exist to serve the reader, not the writer. You write code once; it gets read dozens or hundreds of times by you, your team, and future maintainers. Consistent conventions reduce cognitive load and make code reviews dramatically faster.
Naming Variables โ The Art of Self-Documenting Code
Variable names should reveal intent, not implementation. A variable named x tells you nothing. A variable named remainingSessionTimeSeconds tells you everything. The convention is lowerCamelCase โ first word lowercase, each subsequent word capitalized, no separators.
// โ BAD: cryptic, meaningless names
int x = 86400;
double d = 0.18;
String s = "ACTIVE";
boolean b = true;
List<String> l = new ArrayList<>();
// โ
GOOD: intent-revealing, self-documenting names
int secondsInOneDay = 86400;
double gstRateIndia = 0.18;
String accountStatus = "ACTIVE";
boolean isEmailVerified = true;
List<String> errorMessages = new ArrayList<>();
// โ
GOOD: Boolean variable names โ use is/has/can/should prefix
boolean isLoggedIn = false;
boolean hasAdminPrivilege = true;
boolean canEditProfile = false;
boolean shouldRetry = true;
// โ
GOOD: Collection names โ plural noun
List<User> users = new ArrayList<>();
Map<String, Integer> scores = new HashMap<>();
Set<String> uniqueEmails = new HashSet<>();
// โ
GOOD: Loop variables โ descriptive for complex loops
for (int rowIndex = 0; rowIndex < matrix.length; rowIndex++) {
for (int colIndex = 0; colIndex < matrix[rowIndex].length; colIndex++) {
// Nested loop: explicit names prevent confusion
}
}Special Variable Patterns: Acronyms in Names
When an identifier contains an acronym (URL, HTTP, ID, XML), Java convention has evolved: treat the acronym like a normal word in camelCase. So prefer userId over userID, httpRequest over hTTPRequest, xmlParser over xMLParser. Google's Java Style Guide mandates this pattern, making code more predictable.
// โ Inconsistent acronym treatment (old style)
String userID = "U001";
String baseURL = "https://api.example.com";
int XMLlength = 1024;
class HTTPSClient { }
// โ
Modern Java / Google Style: acronym = normal word
String userId = "U001"; // Id, not ID
String baseUrl = "https://api.example.com"; // Url, not URL
int xmlLength = 1024; // Xml, not XML
class HttpsClient { } // Https, not HTTPS
// Exception: standalone acronyms (all-caps is fine for constants)
static final String BASE_URL = "https://api.example.com";
static final int HTTP_PORT = 80;
static final int HTTPS_PORT = 443;Naming Methods โ Verb-First, Action-Oriented
Methods represent actions. Their names should always start with a verb and follow lowerCamelCase. A well-named method name reads like plain English: user.sendVerificationEmail(), account.calculateMonthlyInterest(), order.cancelWithRefund(reason).
Methods that retrieve a value use the 'get' prefix: getName(), getAccountBalance(), getUserId(). Boolean getters typically use 'is', 'has', 'can': isActive(), hasPermission(), canExecute(). This is the JavaBeans convention used by frameworks like Spring, Hibernate, and Jackson.
Methods that modify state use the 'set' prefix: setName(String name), setBalance(double amount). In modern Java (especially with immutable records and builders), setters are often replaced by 'with' methods: withName(name), withBalance(amount) โ returning a new object.
Static methods that create objects use: create(), of(), from(), build(), newInstance(). Examples: List.of(), Optional.of(), LocalDate.from(), UserBuilder.build(). Java standard library uses this pattern extensively.
Methods that check conditions: validateEmail(), isExpired(), checkPermissions(), verifySignature(). Boolean-returning validators use 'is/has/can': isValidEmail(), hasActiveSubscription().
Methods that convert between types: toString(), toJson(), asMap(), convertToCsv(). Java uses 'to' for type conversions (toString(), toLong()) and 'as' for view-type operations.
Methods that perform operations: executeQuery(), processPayment(), handleRequest(), sendEmail(), fetchUserData(). Use strong, specific verbs โ 'process' is better than 'do', 'calculate' is better than 'get' for computation.
public class PaymentService {
// โ BAD: vague, noun-based, unclear intent
public void payment() { }
public boolean check(String card) { return false; }
public String data(long id) { return null; }
public void thing(Order order) { }
// โ
GOOD: verb-first, intent-revealing
public void processPayment(Payment payment) { }
public boolean validateCreditCard(String cardNumber) { return false; }
public String fetchTransactionDetails(long transactionId) { return null; }
public void cancelOrderWithRefund(Order order) { }
// โ
GOOD: Getter/Setter pattern (JavaBeans)
private double taxRate;
public double getTaxRate() { return taxRate; }
public void setTaxRate(double taxRate) { this.taxRate = taxRate; }
// โ
GOOD: Boolean method โ 'is' prefix
public boolean isPaymentExpired(Payment payment) { return false; }
public boolean hasInsufficientBalance(Account account) { return false; }
// โ
GOOD: Factory method โ 'of' pattern
public static PaymentService of(String apiKey) {
return new PaymentService();
}
}Naming Classes & Interfaces โ PascalCase & Design Patterns
Class names use PascalCase (UpperCamelCase) โ every word starts with a capital letter. Class names should be nouns or noun phrases that describe what the class is. Interface names are typically adjectives (ending in -able, -ible) or nouns representing a contract or role.
// โ
GOOD: Nouns / Noun phrases for Classes
class User { }
class BankAccount { }
class HttpRequestHandler { }
class OrderLineItem { }
class DatabaseConnectionPool { }
// โ
GOOD: Adjectives / Role-describing names for Interfaces
interface Runnable { } // Can be run
interface Serializable { } // Can be serialized
interface Comparable<T> { } // Can be compared
interface AutoCloseable { } // Can be auto-closed
interface UserRepository { } // Repository role (DDD)
// โ
GOOD: Design Pattern names embedded in class name
class UserServiceImpl implements UserService { } // Implementation
class PaymentFactory { } // Factory Pattern
class OrderBuilder { } // Builder Pattern
class LoggerSingleton { } // Singleton Pattern
class NotificationObserver { } // Observer Pattern
class DatabaseProxy { } // Proxy Pattern
// โ BAD: Vague, abbreviation-heavy, non-descriptive
class Mgr { } // Manager of what?
class Util { } // Utility for what?
class Data { } // What kind of data?
class Obj { } // Just 'object'?
class Helper { } // Helping with what?Abstract Class Naming
Abstract classes can optionally use the Abstract prefix to signal that they are not directly instantiable: AbstractUserService, AbstractRepository, AbstractController. Spring Framework uses this pattern extensively (e.g., AbstractApplicationContext). However, many modern style guides prefer just the noun form when context makes it clear.
Naming Constants โ SCREAMING_SNAKE_CASE
Constants in Java โ static final fields โ use SCREAMING_SNAKE_CASE: all uppercase letters with words separated by underscores. This convention makes constants visually pop out in code, signaling to every reader that this value cannot change at runtime.
public class AppConstants {
// โ
Mathematical constants
public static final double PI = 3.141592653589793;
public static final double EULER_NUMBER = 2.718281828459045;
// โ
Configuration constants
public static final int MAX_RETRY_ATTEMPTS = 3;
public static final int DEFAULT_TIMEOUT_MS = 5000;
public static final int MAX_POOL_SIZE = 20;
public static final String DEFAULT_CHARSET = "UTF-8";
public static final String DATE_FORMAT_ISO8601 = "yyyy-MM-dd'T'HH:mm:ssZ";
// โ
HTTP constants
public static final int HTTP_PORT = 80;
public static final int HTTPS_PORT = 443;
public static final String API_VERSION = "v2";
// โ
Enum constants (inside enum โ same SCREAMING_SNAKE convention)
enum OrderStatus {
PENDING,
PAYMENT_RECEIVED,
PROCESSING,
SHIPPED,
DELIVERED,
CANCELLED_BY_USER,
CANCELLED_BY_SYSTEM
}
// โ BAD: camelCase for constants โ confusing, unprofessional
public static final int maxRetryAttempts = 3; // Wrong convention
public static final String defaultCharset = "UTF-8"; // Wrong
}Naming Packages โ Reverse Domain + Lowercase
Package names use all lowercase letters and typically follow reverse internet domain name convention to guarantee global uniqueness. This prevents class name collisions between different organizations' code.
// โ
Standard: reverse domain + project + module
package com.techsustainify.banking.account;
package com.techsustainify.banking.payment;
package org.apache.commons.lang3;
package io.spring.framework.context;
// โ
Open-source project (no domain): short project name
package java.util;
package java.lang;
package javax.servlet;
// โ
Internal enterprise package structure
package com.company.projectname.feature.layer;
// Example: com.infosys.bankingapp.transfer.service
// com.wipro.hrms.payroll.repository
// in.gov.uidai.aadhaar.verification
// โ BAD: uppercase letters โ violates convention
package Com.TechSustainify.Banking; // WRONG
// โ BAD: spaces or hyphens (impossible anyway โ compile error)
// package com.tech sustainify; // Compile error
// โ
If package name contains reserved word: append underscore
package com.example.int_; // 'int' is keyword, add underscore
package com.example.class_; // 'class' is keyword, add underscoreUnicode Identifiers โ Java's Global Language Support
Java source code is encoded in Unicode (UTF-16 internally). This means identifiers can use letters from virtually any human language โ not just English. The JLS ยง3.8 defines a valid identifier character as any character for which Character.isJavaIdentifierStart() returns true (for the first character) or Character.isJavaIdentifierPart() returns true (for subsequent characters).
public class UnicodeDemo {
public static void main(String[] args) {
// โ
Valid: Hindi (Devanagari) identifiers
int เคเคฎเฅเคฐ = 25; // 'umra' = age in Hindi
String เคจเคพเคฎ = "Rahul"; // 'naam' = name in Hindi
// โ
Valid: Japanese identifiers
int ๅนด้ฝข = 30; // 'nenrei' = age in Japanese
// โ
Valid: Arabic identifiers
double ุณุนุฑ = 99.99; // 'si'r' = price in Arabic
// โ
Valid: Greek mathematical notation
double ฯ = Math.PI;
double ฮป = 0.5; // lambda โ useful in physics code
double ฮx = 0.001; // delta-x
// โ
Valid: Unicode escape sequences
int \u0041ge = 25; // \u0041 = 'A', so identifier is 'Age'
System.out.println(เคจเคพเคฎ + " is " + เคเคฎเฅเคฐ + " years old.");
}
}Character.isJavaIdentifierStart() vs isJavaIdentifierPart()
// Java's built-in identifier validation methods
public class IdentifierValidator {
public static boolean isValidIdentifier(String name) {
if (name == null || name.isEmpty()) return false;
// First character: must be valid START character
if (!Character.isJavaIdentifierStart(name.charAt(0))) {
return false;
}
// Remaining characters: must be valid PART characters
for (int i = 1; i < name.length(); i++) {
if (!Character.isJavaIdentifierPart(name.charAt(i))) {
return false;
}
}
return true;
}
public static void main(String[] args) {
System.out.println(isValidIdentifier("age")); // true
System.out.println(isValidIdentifier("2age")); // false
System.out.println(isValidIdentifier("_count")); // true
System.out.println(isValidIdentifier("my-var")); // false
System.out.println(isValidIdentifier("เคจเคพเคฎ")); // true (Unicode)
}
}Special Characters: Underscore (_) and Dollar Sign ($)
Underscore (_) and dollar sign ($) are the only two non-alphanumeric characters allowed in Java identifiers. Both can appear anywhere in an identifier โ as the start, middle, or end. Each has specific conventional uses and important caveats.
Underscore (_) โ Convention and Evolution
// โ
Java 7+: Underscores in numeric literals (readability)
int population = 1_400_000_000; // 1.4 billion
long nationalDebt = 3_000_000_000_000L;
double pi6digits = 3.141_592;
int hexColor = 0xFF_00_FF; // In hex literals too!
// โ
Java 21+: Unnamed variable pattern (underscore as throwaway)
try {
riskyOperation();
} catch (Exception _) { // We don't need the exception object
log.warn("Operation failed, retrying...");
}
// โ
Java 21+: Unnamed pattern variable
if (obj instanceof Point(var x, var _)) { // y-coordinate unused
System.out.println("X coordinate: " + x);
}
// โ Java 21+: Single _ as named variable โ ILLEGAL
// int _ = 5; // Compile error in Java 21+Dollar Sign ($) โ Tools Territory
The dollar sign ($) is technically valid in any identifier position, but Java conventions reserve it for automatically generated code. Compilers, frameworks, and bytecode manipulation tools use $-prefixed names for synthetic classes (e.g., OuterClass$InnerClass, Lambda$1). Human-written code should never use $ in identifiers โ it signals 'auto-generated' to any experienced Java developer.
// โ
How the COMPILER uses $ (you'll see these in bytecode)
// Inner class: OuterClass$InnerClass.class
// Anonymous class: OuterClass$1.class, OuterClass$2.class
// Lambda: ClassName$$Lambda$1.class
// Record: Point$record.class
// โ AVOID: $ in hand-written code
String $name = "Tech"; // Confusing โ looks auto-generated
class $UserService { } // Never do this
// โ ๏ธ Exception: JavaScript interop (GWT, legacy code)
// Some frameworks used $ for bridge classes โ acceptable in that context
// โ
The only acceptable human use: Lombok-generated code
// (Lombok sometimes generates fields with $ to avoid name clashes)
// But even then, Lombok handles it โ you never write $ yourselfBad Practices & Anti-Patterns โ What Senior Developers Reject
These identifier anti-patterns are the most common reasons for failed code reviews in professional Java teams. Learn what NOT to do โ and why each pattern is harmful.
Using 'x', 'y', 'z', 'a', 'b' as variable names outside tiny mathematical contexts is universally rejected. Exception: loop counters (i, j, k) in short loops, and generic type parameters (T, E, K, V) are acceptable. Every other variable deserves a meaningful name.
Prefixing variable names with their type (str, int, b, arr) was a C-era practice. Java's strong type system and modern IDEs make this completely redundant โ type is always visible from declaration or inferred. strUserName โ userName. intMaxRetry โ maxRetry. bIsActive โ isActive.
'usr' saves 2 characters over 'user' while costing every reader a mental decoding step. In a 100,000-line codebase, multiply that decode cost by every reader. Modern IDEs have autocomplete โ type the full word. 'calculateMonthlyInterest()' is infinitely better than 'calcMthlyIntr()'.
Names that lie are the worst bug vectors. A variable named 'totalAmount' that actually holds the discounted price is a disaster waiting to happen. A method named 'getUser()' that also modifies state is a surprise for every caller. Names must truthfully represent what the variable holds or the method does โ always.
Classes named 'UserManager', 'DataObject', 'RequestHandler', 'InfoHelper' communicate almost nothing. These names become dumping grounds for unrelated code (God Class anti-pattern). Use names that describe specific responsibilities: 'UserRegistrationService', 'PaymentRequestValidator', 'JwtTokenParser'.
Having 'fetchUser()', 'getOrder()', 'retrieveProduct()', 'loadInvoice()' in the same codebase for the same operation is confusing. Pick one verb and stick to it project-wide. Consistent naming lets developers predict method names โ 'if Order has fetchOrder(), I bet User has fetchUser()'. This is part of the 'Principle of Least Surprise'.
// โ ANTI-PATTERN 1: Meaningless single letters
int a = getUserCount();
int b = getActiveUsers();
double c = a / (double) b * 100;
// โ
BETTER: Self-documenting
int totalUsers = getUserCount();
int activeUsers = getActiveUsers();
double activeUserPercentage = totalUsers / (double) activeUsers * 100;
// โ ANTI-PATTERN 2: Hungarian Notation
String strFirstName;
int intAge;
boolean bIsAdmin;
List<String> arrNames;
// โ
BETTER: Type-free naming
String firstName;
int age;
boolean isAdmin;
List<String> names;
// โ ANTI-PATTERN 3: Abbreviation overload
public int calcTtlAmt(List<Ord> ords, Usr usr, Disc dsc) {
int ttl = 0;
for (Ord o : ords) { ttl += o.getAmt(); }
return applyDsc(ttl, dsc, usr);
}
// โ
BETTER: Full, readable names
public double calculateTotalAmount(List<Order> orders, User user, Discount discount) {
double totalAmount = 0.0;
for (Order order : orders) {
totalAmount += order.getAmount();
}
return applyDiscount(totalAmount, discount, user);
}Real-World Production Code Examples โ Identifiers in Context
The following examples model identifier naming in real enterprise Java codebases โ Spring Boot microservice pattern with proper naming at every layer.
package com.techsustainify.userservice.domain;
// โ all lowercase, reverse domain, feature-first structure
import java.time.LocalDateTime;
import java.util.Optional;
// Class: PascalCase, noun phrase
public class UserAccount {
// Constants: SCREAMING_SNAKE_CASE
private static final int MAX_LOGIN_ATTEMPTS = 5;
private static final long SESSION_TIMEOUT_MS = 1_800_000L; // 30 min
private static final String DEFAULT_TIMEZONE = "Asia/Kolkata";
// Fields: lowerCamelCase, nouns
private final long userId;
private String emailAddress;
private String hashedPassword;
private boolean isEmailVerified;
private boolean isAccountLocked;
private int failedLoginAttempts;
private LocalDateTime lastLoginTimestamp;
private LocalDateTime accountCreatedAt;
// Constructor: same name as class (PascalCase)
public UserAccount(long userId, String emailAddress) {
this.userId = userId;
this.emailAddress = emailAddress;
this.isEmailVerified = false;
this.isAccountLocked = false;
this.failedLoginAttempts = 0;
this.accountCreatedAt = LocalDateTime.now();
}
// Getters: get + FieldName (camelCase)
public long getUserId() { return userId; }
public String getEmailAddress() { return emailAddress; }
public boolean isEmailVerified() { return isEmailVerified; }
public boolean isAccountLocked() { return isAccountLocked; }
public LocalDateTime getLastLoginTimestamp() { return lastLoginTimestamp; }
// Action methods: verb + noun, lowerCamelCase
public void recordSuccessfulLogin() {
this.lastLoginTimestamp = LocalDateTime.now();
this.failedLoginAttempts = 0;
this.isAccountLocked = false;
}
public void recordFailedLoginAttempt() {
this.failedLoginAttempts++;
if (this.failedLoginAttempts >= MAX_LOGIN_ATTEMPTS) {
lockAccount();
}
}
// Private helper: same convention, private visibility
private void lockAccount() {
this.isAccountLocked = true;
}
// Validation: is/has/can prefix for boolean return
public boolean isEligibleForPasswordReset() {
return isEmailVerified && !isAccountLocked;
}
public boolean hasExceededLoginAttempts() {
return failedLoginAttempts >= MAX_LOGIN_ATTEMPTS;
}
// Factory method: static, 'of' pattern
public static UserAccount of(long userId, String email) {
return new UserAccount(userId, email);
}
}package com.techsustainify.userservice.repository;
// Interface: PascalCase, role-based noun
public interface UserAccountRepository {
// Method: verb + noun, returns Optional for nullable results
Optional<UserAccount> findByUserId(long userId);
Optional<UserAccount> findByEmailAddress(String emailAddress);
List<UserAccount> findAllLockedAccounts();
// Persistence methods: save/delete/update convention
UserAccount save(UserAccount userAccount);
void deleteByUserId(long userId);
boolean existsByEmailAddress(String emailAddress);
// Query methods: count/sum/aggregate pattern
long countActiveUsersRegisteredAfter(LocalDateTime registrationDate);
}Identifier Validation Flowchart โ Is My Name Valid?
Use this decision flowchart to instantly determine whether any identifier you write is valid in Java.
Code Execution Flow โ from source to output
Java Identifier Interview Questions โ Beginner to Advanced
These questions are consistently asked in Java fresher interviews, OCPJP/OCA certification exams, and senior-level code review discussions.
Practice Questions โ Test Your Identifier Knowledge
Challenge yourself with these carefully crafted practice questions. Cover the answer and attempt each one independently โ active recall is proven to be 2โ3x more effective than passive reading.
1. How many valid identifiers are in this list? for, While, null, _x, 3d, $price, class, TRUE, int_, go_to
Medium2. What is wrong with this identifier? 'employee_first_name' Is it valid? Is it good practice in Java?
Easy3. Rename these poorly-named identifiers to follow Java best practices: a) int x = getCount(); b) String s1, s2; c) boolean flag; d) class Mgr {} e) static final int n = 100;
Easy4. Will this compile? Why or why not? public class String { public static void main(String[] args) { System.out.println("test"); } }
Hard5. What Java naming convention should you use for each of these? a) A class that parses JSON b) A method that checks if email is valid c) The maximum file size limit d) A package for payment processing e) A type parameter for a generic container
Easy6. Can you declare two variables with names 'userid' and 'userId' in the same scope? What about 'userid' and 'USERID'?
Medium7. What is the output (or error) for: int true_ = 10; System.out.println(true_);
Medium8. Is 'var' a keyword in Java 10+? Can it be used as a variable name?
HardConclusion โ Identifiers Are the Language of Your Codebase
Identifiers are far more than a syntactic formality. They are the primary communication channel between you and every developer who reads your code โ including your future self. Every name you choose either adds clarity or adds confusion. Every abbreviation you use either saves time for the writer or costs time for every reader.
The difference between a junior developer and a senior developer is often visible in their identifier choices. Junior code is full of x, temp, data, Mgr, and strName. Senior code reads like well-written prose: remainingSessionTimeSeconds, processPaymentWithRetry(), isEmailVerifiedAndAccountActive(), MAX_CONCURRENT_CONNECTIONS.
Your next step: Java Syntax โ where identifiers and keywords combine to form valid Java statements, expressions, and declarations. Understanding syntax rules will make you able to write any Java program from scratch with confidence. โ