Var with Style: Local Variable Type Inference in Java

Опубликовано: 24 Октябрь 2018
на канале: Oracle Developers
2,007
31

Stuart Marks, Consulting Member of Technical Staff, Oracle

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, it’s 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. This session presents an overview of the new var feature and describes these style rules. The presentation is liberally supplemented with code examples of good uses as well as misuses of var.


Смотрите видео Var with Style: Local Variable Type Inference in Java онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Oracle Developers 24 Октябрь 2018, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 2,007 раз и оно понравилось 31 людям.