Kinh doanh - Marketing
Kinh tế quản lý
Biểu mẫu - Văn bản
Tài chính - Ngân hàng
Công nghệ thông tin
Tiếng anh ngoại ngữ
Kĩ thuật công nghệ
Khoa học tự nhiên
Khoa học xã hội
Văn hóa nghệ thuật
Sức khỏe - Y tế
Văn bản luật
Nông Lâm Ngư
Kỹ năng mềm
Luận văn - Báo cáo
Giải trí - Thư giãn
Tài liệu phổ thông
Văn mẫu
Giới thiệu
Đăng ký
Đăng nhập
Tìm
Danh mục
Kinh doanh - Marketing
Kinh tế quản lý
Biểu mẫu - Văn bản
Tài chính - Ngân hàng
Công nghệ thông tin
Tiếng anh ngoại ngữ
Kĩ thuật công nghệ
Khoa học tự nhiên
Khoa học xã hội
Văn hóa nghệ thuật
Y tế sức khỏe
Văn bản luật
Nông lâm ngư
Kĩ năng mềm
Luận văn - Báo cáo
Giải trí - Thư giãn
Tài liệu phổ thông
Văn mẫu
Thông tin
Điều khoản sử dụng
Quy định bảo mật
Quy chế hoạt động
Chính sách bản quyền
Giới thiệu
Đăng ký
Đăng nhập
0
Trang chủ
Công Nghệ Thông Tin
Kỹ thuật lập trình
Essential C# 3.0 FOR NET FRAMEWORK 3.5 PHẦN 6
Đang chuẩn bị liên kết để tải về tài liệu:
Essential C# 3.0 FOR NET FRAMEWORK 3.5 PHẦN 6
Thiên Mạnh
62
87
pdf
Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
Một đặc tính quan trọng của giao diện là họ không bao giờ có thể được khởi tạo, bạn có thể không sử dụng mới để tạo ra một giao diện, và do đó, giao diện có thể thậm chí không có nhà thầu hoặc finalizers. Trường hợp giao diện chỉ có sẵn từ các loại thực hiện chúng. | 390 Chapter 10 Exception Handling The code for throwing any exception is simply to prefix the exception instance with the keyword throw. The type of exception used is obviously the type that best describes the circumstances surrounding the error that caused the exception. For example consider the TextNumberParser.Parse method in Listing 10.1. Listing 10.1 Throwing an Exception public sealed class TextNumberParser public static int Parse string textDigit string digitTexts zero one two three four five six seven eight nine int result Array.IndexOf digitTexts textDigit.ToLower if result 0 throw new ArgumentException The argument did not represent a digit textDigit return result Instead of throwing System.Exception it is more appropriate to throw ArgumentException because the type itself indicates what went wrong and includes special parameters for identifying which parameter was at fault. Two similar exceptions are ArgumentNullException and NullReferenceException. ArgumentNullException should be thrown for the inappropriate passing of null arguments. This is a special case of an invalid parameter exception that would more generally when it wasn t null be thrown as an ArgumentException or an ArgumentOutOfRangeException. NullReferenceException is generally something that only the underlying runtime will throw with an attempt to dereference a null value to call a member on an object whose value is null. Instead of causing a NullReferenceException programmers should check parameters for null before Catching Exceptions 391 accessing them and then throw an ArgumentNullException which can provide more contextual information such as the parameter name. Catching Exceptions Throwing a particular exception type enables the type itself to identify the problem. It is not necessary in other words to catch the exception and use a switch statement on the exception message to determine what action to take in light of the exception. Instead C allows for multiple catch blocks each .
TÀI LIỆU LIÊN QUAN
Essential C# 4.0
Ebook Essential practical NMR for organic chemistry: Part 1 - S. A. Richards, J. C. Hollerton
Ebook Essential practical NMR for organic chemistry: Part 2 - S. A. Richards, J. C. Hollerton
Essential SNMP, Second Editio
Essential SNMP, Second Edition
Essential SQLAlchemy
Pro .NET 4 Parallel Programming in C#
Addison Wesley Essential C++
Cocos2d for iPhone 0.99 Beginner's Guide
Windows Phone 7.5: Building Location-aware Applications
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.