2020年12月19日星期六

Why can the large array be synchronized to the smaller array?

Maybe it's a very simple thing, but I'm asking out of curiosity. I think the above situation is a logic error that should not have happened. There are two arrays. First array element number 10. Second array element number 20. When you equate the second array to the first array, it directly includes the values. But I set the size of the first array to be 10.

How is this possible?

Example Code

int[] array1 = new int[10];  int[] array2 = new int[20];  public MainWindow()  {      InitializeComponent();      array1 = array2;  }  
https://stackoverflow.com/questions/65375656/why-can-the-large-array-be-synchronized-to-the-smaller-array December 20, 2020 at 07:57AM

没有评论:

发表评论