Properties Of Array:


In C# 2 Properties ….
  • 1)Length
  • 2) Rank

  • 1) Length-


  • Gets a 32 bit integer that represent the total number of element in all the dimensions of the Array.

  • 2) Rank-


  • Gets the Rank of the array.

  • Example Of Properties :



    using System;
    classPropertiesDemo {
    	static void Main () {
    		int [ ]arr =new int [] {20,30,42,65,78,95};
           
    		Console.WriteLine(“Rank= {0},Length= {1}”, arr.Rank,arr.Length);
    		
            Console.ReadLine();
    	}
    }