• +91 9723535972
  • info@interviewmaterial.com

VB.Net Interview Questions and Answers

Question - Whats The Difference Between Const And Readonly?

Answer -

The readonly keyword is different from the const keyword. A const field can only be initialized at the declaration of the field. A readonly field can be initialized either at the declaration or in a constructor. Therefore, readonly fields can have different values depending on the constructor used. Also, while a const field is a compile-time constant, the readonly field can be used for runtirne constants as in the following example:

public static readonly uint [] = (uint) DateTime,Now.Ticks;

Comment(S)

Show all Coment

Leave a Comment




NCERT Solutions

 

Share your email for latest updates

Name:
Email:

Our partners