Chapter 6 Quick Reference

Chương 6 Quick Reference Để Throw một ngoại lệ Làm điều này sử dụng một ném tuyên bố. Ví dụ: ném FormatException mới (nguồn); Sử dụng các từ khoá kiểm tra. | Chapter 6 Quick Reference To Do this Use a throw statement. For example Throw an exception throw new FormatException source Use the checked keyword. For example Ensure that integer arithmetic is always checked for overflow int number checked number Write a catch handler that catches the specific exception class. For example try Catch a specific exception . catch FormatException fEx . Write a catch handler that catches Exception. For example try Catch all exceptions in a single catch handler . catch Exception ex . Write the code inside a finally block. For example Ensure that some code will always be run even if an exception is thrown try . To Do this finally always run

Bấm vào đây để xem trước nội dung
TÀI LIỆU MỚI ĐĂNG
160    305    2    19-04-2024
Đã 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.