Array:
• An element is a value in an array
• Rank means the dimensions of array
• Lower bound is the starting index of the array
• Array.Copy handles typecasting automatically, allows copying between different types of arrays
Code Listing:Array.Copy
int[] intarray = new int[5] {1,2,3,4,5};
Object[] objarray = new Object[5] {26,27,28};
// Copy first two elements from int array to object array:
Array.Copy(intarray, objarray,2);
No comments:
Post a Comment