One Dimensional Array in C#

In this chapter you will learn:

  • What is single dimensional array?
  • How to declare one dimensional array?
  • How to use single dimensional array in C# programming?

The one dimensional array or single dimensional array in C# is the simplest type of array that contains only one row for storing data. It has single set of square bracket (“[]”). To declare single dimensional array in C#, you can write the following code.

The array age is a one dimensional array that contains only 5 elements in a single row.

  • Programming Example of One Dimensional Array:



    All the element of Books array is:

    1       2        3              4        5

    C#    Java    VB.NET    C++    C



    In this chapter you learned about single dimensional array in C#. You also learned how to store value and access value from single dimensional array. In next chapter you will learn about multi dimensional array in C#.

    More Examples


    Leave a Reply

    Your email address will not be published. Required fields are marked *