Oracle Acd Final Exam
Oracle Acd Final Exam
Section 6
(Answer all questions in this section)
1. Given:
Correct
2. The initialization expression initializes the loop and it is executed only once, as the loop begins.
(1/1) Points
True (*)
False
Correct
Correct
4. You need to calculate the squares of numbers from 1 to 5. Which of the items should be present in your looping statement?
(1/1) Points
Condition Expression , Update Expression
Initialization Expression , Update Expression
Initialization Expression , Condition Expression , Update Expression (*)
Initialization Expression , Condition Expression
Correct
https://myacademy.oracle.com/player/play?in_sessionid=5103025A91A3A042&classroom_id=75055645 1/2
6/28/2021 JFo Java Foundations Final Exam
Statements in the loop are executed once until the condition becomes false.
Statements in the loop are executed once initially, and then the condition is evaluated.
Statements in the loop are executed repeatedly until the condition becomes false.
The number of times a do-while loop is executed is dependent upon the value of the counter variable. (*)
Correct
https://myacademy.oracle.com/player/play?in_sessionid=5103025A91A3A042&classroom_id=75055645 2/2
6/28/2021 JFo Java Foundations Final Exam
Section 6
(Answer all questions in this section)
6. The while loop continually executes a block of statements while a particular condition is false.
(1/1) Points
True
False (*)
Correct
Correct
Correct
9. A continue statement is used to skip the remaining statements in the body of a loop and continue with the next iteration of
the loop.
(1/1) Points
True (*)
False
Correct
Section 7
(Answer all questions in this section)
https://myacademy.oracle.com/player/play?in_sessionid=5103025A91A3A042&classroom_id=75055645 1/2
6/28/2021 JFo Java Foundations Final Exam
Correct
https://myacademy.oracle.com/player/play?in_sessionid=5103025A91A3A042&classroom_id=75055645 2/2
6/28/2021 JFo Java Foundations Final Exam
Section 7
(Answer all questions in this section)
Correct
Correct
int x = 1;
int y = 2;
x=y;
(1/1) Points
Stack memory (*)
PileDriver memory
No memory is allocated
Heap memory
Correct
String s1 = "Hello";
String s2 = "Welcome!";
s1 = s2;
System.out.println("s1: " +s1);
System.out.println("s2: " +s2);
(1/1) Points
s1: Hello
s2: Welcome!
s1: Welcome!
s2: Hello
https://myacademy.oracle.com/player/play?in_sessionid=5103025A91A3A042&classroom_id=75055645 1/2
6/28/2021 JFo Java Foundations Final Exam
s1: Welcome!
s2: Welcome! (*)
s1: Hello
s2: Hello
Correct
Correct
https://myacademy.oracle.com/player/play?in_sessionid=5103025A91A3A042&classroom_id=75055645 2/2
6/28/2021 JFo Java Foundations Final Exam
Section 7
(Answer all questions in this section)
Correct
Correct
18. You have created an Employee class with all required fields and methods. 10 employees join the company. Should you copy
and paste the Employee class for all 10 employees?
(1/1) Points
True
False (*)
Correct
19. To make fields directly accessible to other classes, the class fields must be marked public.
(1/1) Points
True (*)
False
Correct
Correct
https://myacademy.oracle.com/player/play?in_sessionid=5103025A91A3A042&classroom_id=75055645 1/1
6/28/2021 JFo Java Foundations Final Exam
Section 7
(Answer all questions in this section)
Correct
22. If you need to make a particular variable belong to a class rather than any individual instance, what type of variable should
you use?
(1/1) Points
A static variable. (*)
A private variable.
A local variable.
A public variable.
Correct
23. Given the following code, why does your IDE complain that “non-static variable name cannot be referenced from a static
context”?
Correct
24. How would you instantiate the Employee class from a main method located in another class?
https://myacademy.oracle.com/player/play?in_sessionid=5103025A91A3A042&classroom_id=75055645 1/2
6/28/2021 JFo Java Foundations Final Exam
Correct
25. An object reference with a null value points to an empty location in memory.
(1/1) Points
True (*)
False
Correct
https://myacademy.oracle.com/player/play?in_sessionid=5103025A91A3A042&classroom_id=75055645 2/2
6/28/2021 JFo Java Foundations Final Exam
Section 7
(Answer all questions in this section)
Correct
27. How could you write the Employee constructor so that its parameters are named the same as the fields they’re initializing?
Correct
28. You create an Employee object with a String employeeName field. What is the default value for employeeName?
(1/1) Points
null (*)
A space
“Name”
“default”
https://myacademy.oracle.com/player/play?in_sessionid=5103025A91A3A042&classroom_id=75055645 1/2
6/28/2021 JFo Java Foundations Final Exam
Correct
Section 8
(Answer all questions in this section)
29. Using the NetBeans debugger, you can set breakpoints and trace through a program one line at a time.
(1/1) Points
True (*)
False
Correct
Correct
https://myacademy.oracle.com/player/play?in_sessionid=5103025A91A3A042&classroom_id=75055645 2/2
6/28/2021 JFo Java Foundations Final Exam
Section 8
(Answer all questions in this section)
Correct
Correct
Correct
34. Each catch block is an exception handler that handles the type of exception indicated by its argument.
(1/1) Points
True (*)
False
Correct
int (*)
float (*)
Integer
String
Correct
https://myacademy.oracle.com/player/play?in_sessionid=5103025A91A3A042&classroom_id=75055645 2/2
6/28/2021 JFo Java Foundations Final Exam
Section 8
(Answer all questions in this section)
36. A wrapper class encapsulates, or wraps, the primitive types within an object.
(1/1) Points
True (*)
False
Correct
Correct
Correct
Correct
https://myacademy.oracle.com/player/play?in_sessionid=5103025A91A3A042&classroom_id=75055645 1/2
6/28/2021 JFo Java Foundations Final Exam
https://myacademy.oracle.com/player/play?in_sessionid=5103025A91A3A042&classroom_id=75055645 2/2
6/28/2021 JFo Java Foundations Final Exam
Section 8
(Answer all questions in this section)
Correct
42. An array allows you to create a single identifier that can be used to organize many items of the same data type.
(1/1) Points
True (*)
False
Correct
Section 9
(Answer all questions in this section)
Correct
Correct
45. JavaFX doesn’t provide you with UI elements, shapes and text. So you must always create your own graphics.
(1/1) Points
https://myacademy.oracle.com/player/play?in_sessionid=5103025A91A3A042&classroom_id=75055645 1/2
6/28/2021 JFo Java Foundations Final Exam
True
False (*)
Correct
https://myacademy.oracle.com/player/play?in_sessionid=5103025A91A3A042&classroom_id=75055645 2/2
6/28/2021 JFo Java Foundations Final Exam
Section 9
(Answer all questions in this section)
Correct
47. Lambda Expressions provide much more effective and cleaner syntax for working with GUI applications and sorting lists.
(1/1) Points
True (*)
False
Correct
48. The start() method is the entry point for all JavaFX applications.
(1/1) Points
True (*)
False
Correct
Correct
Correct
https://myacademy.oracle.com/player/play?in_sessionid=5103025A91A3A042&classroom_id=75055645 1/1