How to Use Local Variables in Java
Java 10 introduced a feature called local variable type inference, which enables programmers to declare local variables by using var instead of an explicit type. This feature makes it possible to write code that is more concise and more readable. However, its also possible for this feature to be misused, obfuscating code instead of making it more readable. The Java team has published a set of style guidelines that help direct programmers toward uses of var that improve code quality and help them avoid uses that detract from code quality. Style Guidelines for Local Variable Type Inference in Java Java Local Variable Type Inference: Frequently Asked Questions
|
|