O'Reilly logo

From Java to C#: A Developer's Guide by Heng Ngee Mok

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

12.5. Using the System.Array class

I mentioned that all array objects in C# are implicitly objects of the System.Array class. System.Array contains useful methods and properties which you can use. The Length property, [8] discussed earlier, is actually inherited from System.Array. Other methods can be used for creating, manipulating, searching, and sorting arrays.

[8] If you are not sure of C# properties, just treat a property as a public field for now. See Chapter 20 for more information.

I shall introduce the following static methods in System.Array which can be useful for 1D arrays:

  • public static void Reverse (Array array)

  • public static void Sort (Array array)

  • public static int IndexOf (Array array, Object value)

Check out the API documentation ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required