Why is vowels
not null after call my method? string[] is a reference type, I don't understand?
using System;
class Program
{
public static string[] vowels = {"A", "E", "I", "O", "U"};
public static void SetArrayToNull(string[] array)
{
array = null;
}
public static void Main(string[] args)
{
SetArrayToNull(vowels);
Console.WriteLine(vowels == null); //writes "false"
}
}