Answer: We can assign values to Read-only variables either in Variable declaration or in Constructor.
For Example:-
public class Person
{
public readonly string status_deactive = "DD";
public readonly string status_active;
public Person()
{
status_active = "AA";
}
}
Asked In: Many Interviews |
Alert Moderator