Ganesamoorthi M

Ganesamoorthi M

  • NA
  • 129
  • 1.4k

Anyone please clear my doubt on reference Types?

Jul 24 2018 3:32 AM
 Consider the Below Code,
  1. int[] intArray = new int[] { 10, 20, 20, 12, 15, 22, 11, 45, 15, 45 };  
  2. intArray.Distinct();  
  3. foreach (int num in intArray)  
  4. {  
  5. Console.Write(num + " ");  
  6. }  
Array is a Reference type. But when I use Distinct on Array it is not affected. I am confused here. Please anyone clear it.

Answers (2)