~/talk

Var with Style: Local Variable Type Inference in Java

Talkat Oracle Code One 2018 · 2018-10-22..10-25· [java]
slides:none on file

Java 10’s var infers the local type from the right-hand side and must have an initializer, so declarations like var x; or var x = null or var x = (untyped) lambda are disallowed. Reassignment is allowed but the inferred type stays fixed; use final var for immutability. Watch for pitfalls with generics and avoid var+diamond because type arguments may be lost; practical demos use NetBeans 9 on a JSON‑P example and show cleanup of imports. See style guide on OpenJDK.

AI-written summary · about

  1. 0:00Introduction to var
  2. 8:40Focusing on code readability
  3. 11:44Style guide and principles
  4. 17:38Practical code examples
  5. 28:18IDE demonstration
  6. 32:41Summary and Q&A
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.