C# IndexOutOfRangeException
Program.cs
Output
kodingwindow@kw:~/csharp$ dotnet run Array Length: 6 First Element: Mango Last Element: StrawberryUnhandled exception. System.IndexOutOfRangeException: Index was outside the bounds of the array. at Program. kodingwindow@kw:~/csharp$$(String[] args) in /home/kodingwindow/csharp/Program.cs:line 5
C# program to handle the IndexOutOfRangeException
Program.cs
Output
kodingwindow@kw:~/csharp$ dotnet run Array Length: 6 First Element: Mango Last Element: Strawberry Requested element not found kodingwindow@kw:~/csharp$
What Next?
C# program to handle the ArgumentException
C# program to handle the OutOfMemoryException
C# program to handle the TimeZoneNotFoundException
Advertisement