Friday 12 April 2013

what is difference between constant and readonly

constant :

  • Constant is used to at the time of declaration is mandatory.
  • constant can't be modified within a class.
                ex: const float pi=3.14f;


readonly :

  • readonly is used to optional for declaration of values.
  • readonly can be modified with the class 
            ex: readonly string str;

No comments:

Post a Comment