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.
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.
Post a Comment
Post a Comment