Multiple choice technology programming languages

How do you preserve the contents of an array from being cleared when the array is redimensioned?

  1. Using Redim Keyword

  2. Using Preserve Keyword

  3. Using Reserve Keyword

  4. None of the above

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The Preserve keyword in VB.NET is used with ReDim to resize an array while retaining existing values. Without Preserve, ReDim would create a new array and lose all existing data. Options A and C are not valid keywords for this purpose.