Just interested...

Hey,
I've just started learning c# and i have a question:
my book says the readonly (=keyword) approach to defining a static varible (means: public readonly int x;) is better than the static (=keyword) approach (public static int y;). Why?

Comments

  • : Hey,
    : I've just started learning c# and i have a question:
    : my book says the readonly (=keyword) approach to defining a static varible (means: public readonly int x;) is better than the static (=keyword) approach (public static int y;). Why?
    :

    Sure becouse some internal things in the .net compiled code
  • : Hey,
    : I've just started learning c# and i have a question:
    : my book says the readonly (=keyword) approach to defining a static varible (means: public readonly int x;) is better than the static (=keyword) approach (public static int y;). Why?
    :
    the 'readonly' is a static variable that you can not chang it. but 'static' variable you can chang it.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories