Java, Java8, Java21, Java17, Migration.
infers the type of the variable based on the assigned value. This feature aims to improve code readability while maintaining strong typing. public static void main(String[] args) { var name = "John Doe"; // Infers String type var age = 30; // Infers int type var salary = 50000.0; // Infers double