Академический Документы
Профессиональный Документы
Культура Документы
Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct
answer.
Section 4
(Answer all questions in this section)
True
False (*)
Correct
55555
The code does not compile.
An ArrayIndexOutofBoundsException is thrown.
87668 (*)
AtlanticPacificIndianArcticSouthern
Correct
6 (*)
Hudson
8
river
7
Correct
4Suppose that str1 and str2 are two strings. Which of the statements or
Mark for
. expressions are valid?
Review
(1) Points
Str1 -= str2;
str1 >= str2
String str3 = str1 - str2;
str1 += str2; (*)
Correct
2
3 (*)
12
0
11
Correct
Page 1 of 10
Correct
Correct
4geeks (*)
to_be_or_not_to_be
dgo2sleep
R2d2
Correct
Correct
grand Total
boolean
7up
apple (*)
Correct
Page 2 of 10
Section 4
(Answer all questions in this section)
11.A workspace can have one or more stored projects. True or false?
Mark for Review
(1) Points
True (*)
False
Correct
12.In a project, 2 of the classes must contain a main method. True or
Mark for Review
False?
(1) Points
True
False (*)
Correct
True
False (*)
Correct
True
False (*)
Correct
True
False (*)
Correct
Page 3 of 10
Section 5
(Answer all questions in this section)
< (*)
<= (*)
=
!= (*)
All of the above.
Correct
Correct
True
False (*)
Correct
True
False (*)
Correct
20.In a for loop the counter is not automatically incremented after each
Mark for Review
loop iteration. Code must be written to increment the counter. True (1) Points
or false?
True (*)
False
Correct
Page 4 of 10
Section 5
(Answer all questions in this section)
if/else
do-while (*)
while (*)
for (*)
Correct
Section 6
(Answer all questions in this section)
Correct
23.Suppose you are writing a program where the user is prompted to the
Mark for Review
give coordinates where they believe the princess is inside of the
(1) Points
castle.
Your program moves the prince to the coordinates that the user
specified. If the princess is not found at those coordinates, the user is
given a clue that helps them guess coordinates closer to the princess.
The user is allowed to enter their new guess of where the princess is.
Correct
Correct
True
False (*)
Correct
Page 5 of 10
Test: Java Fundamentals Final Exam
Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct
answer.
Section 6
(Answer all questions in this section)
array[4] is null
array[2] is 8
array[0] is undefined
array.length is 8 (*)
Correct
123321
222222
444444 (*)
246642
This code doesn't compile.
Correct
Correct
555555
987654
456789
777777 (*)
This code doesn't compile.
Correct
Section 7
(Answer all questions in this section)
True (*)
False
Correct
Page 6 of 10
Section 7
(Answer all questions in this section)
Correct
Correct
3If the return type from a method is boolean then 2.5 is a valid return value.
Mark for
3.True or false?
Review
(1) Points
True
False (*)
Correct
True (*)
False
Correct
3Consider:
Mark for
5. Review
public class MyClass{ (1) Points
public MyClass()
{/*code*/}
// more code...}
Correct
Page 7 of 10
Section 7
(Answer all questions in this section)
Correct
Correct
3If the return type from a method is boolean then 2.5 is a valid return value.
Mark for
3.True or false?
Review
(1) Points
True
False (*)
Correct
True (*)
False
Correct
3Consider:
Mark for
5.
Review
public class MyClass{
(1) Points
public MyClass()
{/*code*/}
// more code...}
Correct
Page 7 of 10
Section 7
(Answer all questions in this section)
Correct
SqueakyRobot.needOil();
needOil(Robot);
super.needOil(); (*)
Robot.needOil(SqueakyRobot);
Correct
Correct
protected
friendly (*)
default
private
public
Correct
Page 9 of 10
Section 7
(Answer all questions in this section)
46.You can assign new values to static variables by prefacing them with
Mark for Review
the this keyword and a dot or period. True or false? (1) Points
True (*)
False
Correct
Correct
48.Would this code be correct if a Dog is a HousePet? Why or Why
Mark for Review
not?
(1) Points
HousePet Scooby = new Dog();
Correct
Correct
Correct
Page 10 of 10
Section 7
(Answer all questions in this section)
Correct
Correct
Correct
Correct
40.A team is working on a coding project. They desire that all portions
Mark for Review
of their code should have access to the classes that they write. What
(1) Points
access modifier should be used for each class?
public (*)
protected
private
default
All of the above
Correct
Page 8 of 10