TAILIEUCHUNG - Ebook Addison -Essential CSharp 4.0

Thêm hai từ khóa liên quan đến các loại không có hiệu lực. null là một giá trị mà chỉ ra rằng các biến không đề cập đến bất kỳ đối tượng hợp lệ. khoảng trống được sử dụng để chỉ sự vắng mặt của một loại hoặc không có giá trị bất kỳ hoàn toàn. | null and void 51 To actually change the value in text assign the value from ToUpper back into text as in the following text If considerable string modification is needed such as when constructing a long string in multiple steps you should use the data type System. rather than string. includes methods such as Append AppendFormat Insert Remove and Replace some of which also appear on string. The key difference however is that on these methods will modify the data in the StringBuilder itself and will not simply return a new string. null and void Two additional keywords relating to types are null and void. null is a value which indicates that the variable does not refer to any valid object. void is used to indicate the absence of a type or the absence of any value altogether. null null can also be used as a type of string literal. null indicates that a variable is set to nothing. Reference types pointer types and nullable value types can be assigned the value null. The only reference type covered so far in this book is string Chapter 5 covers the topic of creating classes which are reference types in detail. For now suffice it to say that a reference type contains a reference to a location in memory that is different from where the actual data resides. Code that sets a variable to null explicitly assigns the reference to point at nothing. In fact it is even possible to check whether a reference type points to nothing. Listing demonstrates assigning null to a string variable. Listing Assigning null to a String static void Main string faxNumber Chapter 2 Data Types . Clear the value of faxNumber. faxNumber null . It is important to note that assigning the value null to a reference type is distinct from not assigning it at all. In other words a variable that has been assigned null has still been set and a variable with no assignment has not been set and

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.