Java Fundamentals - Teacher - English: Outline

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

4/27/2018 Java Fundamentals - Teacher - English

Java Fundamentals - Teacher - Outline


English
Section 6
(Answer all questions in this section)
26. Which of the following would give you an array index out of bounds Mark for Review
exception? (1) Points
Unintentionally placing a semicolon directly after initializing a for
loop.
Using a single equal symbol to compare the value of two
integers.
Refering to an element of an array that is at an index less than
the length of the array minus one.
Refering to an element of an array that is at an index greater
than the length of that array minus one. (*)
Misspelling a variable name somewhere in your code.

Correct
27. What are exceptions used for in Java? Mark for Review
(1) Points
Exceptions have no use, they are just a part of the Java
language.
Making the program easier to use for the user and reducing the
possibilities of errors occuring.
Correcting mistakes made in your code and handling
extraordinary cases. (*)
Helping the interpreter compile code quicker and handle user
interfaces.
Incorrect. Refer to Section 6 Lesson 2.
28. If an exception has already been thrown, what will the interpreter Mark for Review
read next in the program? (1) Points
Where the program catches the exception. (*)
The next line of the program even if it is not the catch block of
code.
The user input.
The end of the program.

Correct
29. Which of the following could be a reason to throw an exception? Mark for Review
(1) Points
You have a fatal error in your program.
To make the user interface harder to navigate.
To eliminate exceptions from disrupting your program. (*)

http://ilearning.oracle.com/ilearn/en/learner/jsp/player.jsp?rco_id=2005567461&classroom_id=2031716710&scorm_attempt=1524799703122&sessionId=-5493528081

You might also like