You are on page 1of 1

http://ilearning.oracle.com/ilearn/en/assessment/jsp/test_player.

jsp

Test: Java Fundamentals Final Exam


Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.
Section 5
(Answer all questions in this section)

21. The three logic operators in Java are: Mark for Review
(1) Points
&&, !=, =
!=, =, ==
&&, ||, ! (*)
&, |, =

Correct

Section 6
(Answer all questions in this section)
22. What are exceptions used for in Java? Mark for Review
(1) Points
Making the program easier to use for the user and reducing the possibilities of errors
occuring.
Helping the interpreter compile code quicker and handle user interfaces.
Exceptions have no use, they are just a part of the Java language.
Correcting mistakes made in your code and handling extraordinary cases. (*)

Correct

23. Which line of code shows the correct way to throw an exception? Mark for Review
(1) Points
throws new Exception("Array index is out of bounds");
new throw Exception("Array index is out of bounds");
throw new Exception("Array index is out of bounds"); (*)
throw Exception("Array index is out of bounds");

Correct

24. What exception message indicates that a variable may have been mispelled somewhere in the Mark for Review
program? (1) Points
variableName cannot be resolved to a variable (*)
method methodName(int) is undefined for the type className
Syntax error, insert ";" to complete statement
All of the above

Correct

25. It is possible to throw and catch a second exception inside a catch block of code. True or false? Mark for Review
(1) Points
True (*)
False

Correct

Previous Page 5 of 10 Next Summary

1 dari 1 28/10/2016 21:43

You might also like