SEARCH BY

All

  • All
  • Java8
  • Spring

var in java(from java10)

Post a Comment
Final java has variable declaration without worrying of type declaration. The keyword var is introduced in java10.

var age=10;
var name="jai";
var emp= new Employee();

wow what a great feature included in java

Note: we can use var for local variables only, we can not use for instance variables
Note: we must assign the value for var variable at the time of creation.
jaya
I love software designing, coding, writing and teaching...

Share this article

Related Posts

Post a Comment

Place your code in <em> </em> tags to send in comments | Do not add hyper links in commnet

Close

Subscribe our newsletter for the latest articles directly into your email inbox