TAILIEUCHUNG - Professional VB 2005 - 2006 phần 2

Chú ý rằng không có mã trong thói quen này. Bất kỳ mã sẽ được thực hiện và không phải là một phần của giao diện. Chỉ có việc khai báo của phương pháp là quan trọng khi thảo luận về giao diện. Điều này có thể dường như khó hiểu lúc đầu, nhưng nó là một khác biệt quan trọng | Chapter 3 concerns when casting to and from the object type collections should allow you to specify what specific type they will contain. Generics not only prevent you from paying the cost of boxing for value types but add to the ability to create type-safe code at compile time. Generics are a powerful extension to the .NET Simpo PDFirMerge aandr Split UnregisteredaVersion - http Parameter Passing When an object s methods or an assembly s procedures and methods are called it s often appropriate to provide input for the data to be operated on by the code. Visual Basic has changed the way that functions procedures and methods are called and how those parameters are passed. The first change actually makes writing such calls more consistent. Under Visual Basic the parameter list for a procedure call didn t require parentheses. On the other hand a call to a method did require parentheses around the parameter list. In Visual Basic the parentheses are always required and the Call keyword is obsolete. Another change in Visual Basic is the way parameters with default values are handled. As with Visual Basic it is possible to define a function procedure or method that provides default values for the last parameter s . This way it is possible to call a method such as PadRight passing either with a single parameter defining the length of the string and using a default of space for the padding character or with two parameters the first still defining the length of the string but the second now replacing the default of space with a dash. Public Function PadRight ByVal intSize as Integer _ Optional ByVal chrPad as Char c End Function To use default parameters it is necessary to make them the last parameters in the function declaration. Visual Basic also requires that every optional parameter have a default value. It is not acceptable to just declare a parameter and assign it the Optional keyword. In Visual Basic the Optional keyword must be accompanied by

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã 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.