Đang chuẩn bị liên kết để tải về tài liệu:
THE JR PROGRAMMING LANGUAGE phần 6

Không đóng trình duyệt đến khi xuất hiện nút TẢI XUỐNG

Báo cáo đầu vào hỗ trợ xử lý các trường hợp ngoại lệ trong một cách tương tự để hoạt động. Đối với mỗi hoạt động, năng lực phục vụ bởi một tuyên bố đầu vào, ném khoản phải liệt kê tất cả các trường hợp ngoại lệ có thể được ném ra từ cơ thể của lệnh hoạt động tương ứng. | 174 Exceptions clause. This requirement prevents attempts to propagate out of invocations of capabilities and operations exceptions not listed in the respective throws clauses. 12.2 Input Statements Input statements now support exception handling in a manner similar to operations. For each operation or capability serviced by an input statement a throws clause must list all exceptions that may be thrown from the body of the respective operation command. For instance if the servicing code for an operation includes file I O then an lOException may be thrown. If this exception is propagated out of the body of the operation command then it must be included in the throws clause as demonstrated by the following code inni String readFilet throws lOException . 1 void writeFile string data throws lOException . The general form of the input statement discussed in Section 9.1.1 now includes an optional throws clause as part of each operation command. An operation command now has the general form return-type op-expr .formal-list throws exception-list st synch-exprby sched-expr block The exceptions listed in the throws clause of an operation command must match those listed in the throws clause of the operation or capability specified by the op-expr of the operation command. An exception thrown from the body of an operation command is propagated except as discussed in Section 12.3 back to the invoker. Such an exception is never propagated into the enclosing scope of the offending input statement. As such the enclosing scope does not require a catch clauses for the exceptions listed in the operation commands. 12.3 Asynchronous Invocation The exception handling mechanisms provided by sequential programming languages rely upon the call chain for the propagation of exceptions. A thrown exception is propagated either implicitly or explicitly up the call chain until an appropriate handler is found. Figure 12.1 depicts such a propagation in a parser program. Method read throws an .

Đã 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.