var
is considered obsolete and should no longer be used in new codes, it was a time that created the class but did not want to be another language, but then changed their mind and resolved that it would have all the diverse visibilities of a member that other languages had private
, protected
and public
, so this is used between the two possibilities presented.
This way you make it clear that the variable is public, with the old keyword became public but did not make it clear, because it could not be anything else. Since the philosophy of language has changed, it makes more sense.
There are detractors to this idea, but the official position is this.