Constant and readonly variable

Constant and read-only variable cant be modified outside of class where as constant cant be modified within class also. It is possible in case of read-only

Constant required initialization at time of declaration but not required in case of read-only

public const float pi=3.14;
public readonly long l1;
Ebook Download
View all
Learn
View all