From the course: Java Refactoring Best Practices
Unlock this course with a free trial
Join today to access over 25,300 courses taught by industry experts.
Java naming conventions - Java Tutorial
From the course: Java Refactoring Best Practices
Java naming conventions
- [Instructor] The first best practice we'll discuss is sticking to naming conventions. This makes Java code consistent. In one glance of an eye, you can see what you're dealing with if you do this right. And not just for you and future you, but also for other Java developers. They can easily understand what's going on by looking at codes that sticks to these naming conventions. The naming conventions in Java are a set of guidelines for naming variables, methods, classes and packages in Java. Let's go over the guidelines you should follow. Maybe most importantly, make sure to use meaningful and descriptive names for variables and methods. Don't call something "x" when you could also call it "number of cows". Try to avoid single-letter variable names altogether except for looping such as "i". Next up, make sure to use the camelCase notation for variables and methods. Next to being a convention, this also makes the…
Contents
-
-
-
-
Java style guide1m 22s
-
(Locked)
Java naming conventions2m 58s
-
(Locked)
Using spacing, brackets, and comments effectively3m 47s
-
(Locked)
Writing clean and maintainable Java classes5m 43s
-
(Locked)
Best practices for writing clear and concise methods5m 32s
-
(Locked)
Challenge: Applying basic best practices1m 13s
-
(Locked)
Solution: Applying basic best practices54s
-
-
-
-