why in c# we need to initialize primitive type variable? -
this question has answer here:
why in c# need initialize primitive type variable --
static void main(string[] args) { int a; console.writeline(a); } throws compile time error ...
in order prevent potential coding mistakes, c# not allow use local variable until compiler can prove has been initialized.
Comments
Post a Comment