Replace with var

Use quick intentions to replace a local variable type with `var`

You can use ⌥⏎ (macOS) / Alt+Enter (Windows/Linux), to show context actions and replace the type on the left-hand side of the declaration with var (Java 10+). It's best to only do this when it's clear what the type the resulting object will be.


Related Resources

Extract Method
Extract code to a new method
Inline Variable
Inline a variable in your code
Introduce variable
Refactor your code and introduce a new variable