tailieunhanh - C#Your visual blueprint for building .NET applications phần 5

# Cấp phát bộ nhớ trong một trong hai cách: đống và ngăn xếp. Các phương pháp đống cung cấp linh hoạt hơn để các lớp học thường sử dụng phương pháp đống. Các phương pháp tiếp cận ngăn xếp sang một bên bộ nhớ để xử lý. | 5 WORKING WITH TYPES AND INTERFACES Properties and indexers have some similarities the most obvious is that all of the rules defined for the properties get and set accessors also apply to the indexer get and set accessors. Although properties and indexers are related you should be aware of some significant differences Visual C identifies a property by its name and an indexer by its signature. You can access a property with a simple name. You must access an indexer through an element. A property can have a static object that does not change. An indexer must contain instance information generated by the class. The get accessor of a property has no additional parameters. The get accessor of an indexer has the same parameters as the indexer. The set accessor of a property contains the implicit value parameter. The set accessor of an indexer has the value parameter and the additional indexer parameters. - Type the indexer parameter name s in the Parameter name field. L Add the name s to the Parameter list field by clicking the Add button. G Click to select the indexer modifier from the Indexer modifiers area. L-B The indexer code skeleton appears in your class code so you can edit it. -B Type a comment for your indexer. L- Click the Finish button. 115 C VIEW INFORMATION ABOUT METHODS method is a piece of code that implements an action that a class or object can perform. Methods appear within a class and provide additional information that method has a unique signature. C identifies a signature by looking for specific method features including the method name and the method parameters. classes cannot handle. C supports two types of methods static and non-static. All objects in a class can access the static methods in that class without creating any instance of that class. Instances of a class can only access non-static methods. For more information on adding static and non-static methods see pages 6 to 13. You can only add a method when you are editing a class. When you

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.