Package lombok
Annotation Type var
-
public @interface varUsevaras the type of any local variable declaration (even in aforstatement), and the type will be inferred from the initializing expression (any further assignments to the variable are not involved in this type inference).For example:
var x = 10.0;will inferdouble, andvar y = new ArrayList<String>();will inferArrayList<String>.Note that this is an annotation type because
var x = 10;will be desugared to@var int x = 10;Complete documentation is found at the project lombok features page for @var.