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 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 10 Quiz Database Programming With SQL

Section 10 Quiz             (Answer all questions in this section) 1.         A multiple-row operator expects how many values?   Mark for Review (1) Points             One or more (*)             Only one             Two or more             None 2.         The salary column of the f_staffs table contains the following values: 4000 5050 6000 11000 23000 Which of the following statements will return the last_name and first_name of those employees who earn more than 5000?  Mark for Review (1) Points             SELECT last_name, first_name ...

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