Created
October 24, 2023 15:18
-
-
Save adamstirtan/b477ebe4aeed9f6deefe861ee4be0714 to your computer and use it in GitHub Desktop.
Fixed design flaws
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| class Program | |
| { | |
| static void Main(string[] args) | |
| { | |
| try | |
| { | |
| int[] numbers = new int[5]; | |
| int value = numbers[10]; | |
| Console.WriteLine("Value: " + value); | |
| } | |
| catch (IndexOutOfRangeException ex) | |
| { | |
| Console.WriteLine("Index out of range: " + ex.Message); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment