What is the purpose of `var` keyword introduced in Java 10?

Java Professional Medium

Java Professional — Medium

What is the purpose of `var` keyword introduced in Java 10?

Key points

  • `var` does not declare a variant type or dynamic typing like JavaScript
  • It does not make a variable visible across all scopes
  • The purpose of `var` is to improve code readability and maintain type safety

Ready to go further?

Related questions