2013年5月28日 星期二

C# Fundation, Part 3 (Arrays)

1. If the index is to big to exceed the array, the error will show System.IndexOutOfRangeException: Index was outside the bounds of the array

2. Array.IndexOf(Array array, object value), search for object value and return the first index that matchs with the value. If not found, it will return -1

image

 

Example:

image

 

Following 2 are the same:

image

Single line Collection of objects

image

 

Built-in functions provide for Array type

image

 

Array inherit from multiple interfaces

image

It still works by changing from string[ ] to IList

image

沒有留言:

張貼留言