Langsung ke konten utama

Section 3 Exception and assertion Oracle Java Programming

Section 3 Exception and assertion
                (Answer all questions in this section)

1.            What is the definition of a logic error?    Mark for Review
                Wrong syntax that will be caught at compile time.
                Bugs in code that make your program run different than expected (*)
                Computer malfunction that makes your code run incorrectly.
                Something that causes your computer to crash.

2.            Is this the correct syntax for catching an exception?
Try(inputStream = "missingfile.txt"); Catch(exception e);
True or false? 
                True
                False (*)

3.            Multiple catch statements can be used for a single try statement.
True or false?    Mark for Review
                True (*)
                False

4.            When will a finally statement be executed?         Mark for Review
                Only if an exception is thrown.
                Only if an exception is not thrown.
                Always; no matter if an exception is thrown or not. (*)
                Only if multiple exceptions are caught and thrown.
                Never; it is there for visual purposes.

5.            What is one step you must do to create your own exception?      Mark for Review
                Create a new class that extends Exception. (*)
                Create a new class that implements Exception.
                Declare the primitive data type Exception.
                Exceptions cannot be created. They are only built in to Java.

6.            What is special about including a resource in a try statement?    Mark for Review
                                                (Choose all correct answers)      
                The resources will auto-close. (*)
                The program will fail if the resource does not open.
                An error will be thrown if the resources does not open. (*)

7.            Assertions are optional ways to catch logic errors in code.
True or false?    Mark for Review
                True (*)
                False

8.            When are control flow invariants used? Mark for Review
                To test run time errors in code.
                To test compilation errors in your code.
                To test specific variable values of your code.

                To test the correct flow of your code. (*)

Komentar

  1. The Golden Nugget Casino & Hotel | Henderson NV | KTNV
    The Golden Nugget Casino & 원주 출장샵 Hotel is 이천 출장샵 Henderson's premier 원주 출장안마 destination for entertainment and fine dining, featuring a variety 통영 출장마사지 of culinary 경산 출장마사지 offerings.

    BalasHapus

Posting Komentar

Postingan populer dari blog ini

Section 6 Quiz Database Design Oracle

Section 6 Quiz             (Answer all questions in this section) 1.         Examine the following Entity and decide which rule of Normal Form is being violated: ENTITY: CLIENT ATTRIBUTES:     # CLIENT ID     FIRST NAME     LAST NAME     STREET     CITY     ZIP CODE  Mark for Review (1) Points             1st Normal Form.             2nd Normal Form.             3rd Normal Form.             None of the above, the entity is fully normalised. (*) 2.         A transitive dependency exists when any attribute in an entity...

Section 6 Quiz Oracle Database Programming with SQL

Section 6 Quiz             (Answer all questions in this section)                                                             1.         Given the following descriptions of the employees and jobs tables, which of the following scripts will display each employee メ s possible minimum and maximum salaries based on their job title? EMPLOYEES Table: Name   Null?    Type EMPLOYEE_ID          NOT NULL     NUMBER (6) FIRST_NAME             VARCHAR2 (20) ...

Section 9 Quiz Database Design Oracle

Section 9 Quiz             (Answer all questions in this section) 1.         When translating an arc relationship to a physical design, you must turn the arc relationships into foreign keys. What additional step must you take with the created foreign keys to ensure the exclusivity principle of arc relationships? (Assume that you are implementing an Exclusive Design) (Choose Two)     Mark for Review (1) Points                                     (Choose all correct answers)               Make all relationships mandatory             Make all relationships optional (*) ...