tailieunhanh - Bài giảng Lập trình C# 2010: Chương 4 - ĐH Công nghệ Đồng Nai

Bài giảng Lập trình C# 2010: Chương 4 trình bày về Using Arrays and Collections (Sử dụng mảng và Bộ sưu tập) như khái niệm, đặc điểm, cú pháp, thao tác thực hiện và các nội dung khác. | 1 One Dimension Array 1 Multi Dimension Array 2 Array class 3 ArrayList class 4 Dictionary class 5 2 5 2 9 7 6 0 8 M[0] M[1] M[3] M[5] M[2] M[4] M[6] - Same name - Same type - Get Element by Index ( 0 n-1) One Dimension Array 3 Programmer specifies the type of the elements of the array new operator to allocate dynamically the number of elements in the array Array declarations and initializations need not be in the same statement In arrays of value types, each element contains one value of the declared type Declaring & Creating Arrays 4 [ ] ; int [ ] M; Button[ ] arrButton; M=new int[10]; Button []arrButton=new Button[10]; Declaring: =new [ ARRAY_SIZE]; Creating: 5 int M1[]=new int[10]; for(int i=0;i [ ] ; int [ ] M; Button[ ] arrButton; M=new int[10]; Button []arrButton=new Button[10]; Declaring: =new [ ARRAY_SIZE]; Creating: 5 int M1[]=new int[10]; for(int i=0;i<;i++) M1[i]=i*2; for(int i=0;i<;i++) (M1[i] + “”); foreach(int value in M1) (value + “”); int M2[]={1,4,2} ; Examples 6 : return size of array (int index): return

TỪ KHÓA LIÊN QUAN
crossorigin="anonymous">
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.