Demonstrate readonly

image_pdfimage_print

/*
C#: The Complete Reference
by Herbert Schildt

Publisher: Osborne/McGraw-Hill (March 8, 2002)
ISBN: 0072134852
*/

// Demonstrate readonly.

using System;

class MyClass {
public static readonly int SIZE = 10;
}

public class DemoReadOnly {
public static void Main() {
int[]nums = new int[MyClass.SIZE];

for(int i=0; i