Wenn wir folgende Anweisung schreiben, taucht beim Kompilieren ein Fehler auf:
private const int[,] matrix = new int[,] { { 12, 13, 14 }, { 16, 43, 21 }, { 12, 13, 54 } }; |
Mithilfe des Schlüsselwortes readonly lässt sich die Anweisung ändern in:
private readonly int[,] matrix = new int[,] { { 12, 13, 14 }, { 16, 43, 21 }, { 12, 13, 54 } }; |
