Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
TM
D Student Sign In
[ UO
C ~ I D ilea rning .o racle.com/ilearn/en/ learner/jsp/playerJsp ?rco_id = 1340353197 &classroom_id = 1361817065&scorm_attem pt= 143176954275S&sessionld =4256988481L
~
Outline
1~
0 .
?
Outline
X
Review your answers, feedback, and question scores below. An aste1isk (*) indicates a correct answer.
Section 4
(Answer all questions in this section)
Collect
Compile (*)
Package
Assemble
Correct
2. You can return to the Eclipse Welcome Page by choosing Welcome from what menu?
3. For eve1y opening curly brace { there does not need to be a closing curly brace} for the program to compile without error. True or False?
True
False (*)
4. A workspace can not have more than one stored projects. True or false?
True
False (*)
Correct
1
2
3
4
5
C01rect
for Review
( 1) Points
Correct
~lark
File
Edit
Help (* )
Close
/ **
* @par am args
*I
--
1H Facebook
TM
D Student Sign In
[UO
C ~ I D ilea rning .o racle.com/ ilearn/en/ learner/jsp/playerJsp ?rco_id = 1340353197 &classroom_id = 1361817065&scorm_attem pt= 143176954275S&sessionld =4256988481L
+~
Outline
Outline
Correct
3. For eve1y opening curly brace { there does not need to be a closing curly brace} for the program to compile without error. T111e or False?
True
False (*)
1m
True
False (*)
Correct
--
C01rect
4. A workspace can not have more than one stored projects. True or false>
...
1:
34
1
2
3
4
5
6
7
8
9
10
11
12
13
~lark
AJ
__./
(B)
*I
public sta tic void main(String[] args ) {
//TODO Auto-generated method stub
}
for Review
( 1) Points
f'-
~
__./
Page 1 of 10
. ...
';!
Correct
I Next I I Summary I
~~~~~~~~~~~~~~~~~~ ...
~~
u<u~
y
_
.
_ _._. _- u_",._ _ _ __ j
SnapShot: p rintscreen
'\. x
~
I IC >l
13:34
'
> ~ v
'='
16.05.2015
1H Facebook
TM
D Student Sign In
[UO
C ~ I D ilea rning .o racle.com/ilearn/en/ learner/jsp/playerJsp ?rco_id = 1340353197 &classroom_id = 1361817065&scorm_attem pt= 143176954275S&sessionld =4256988481L
+~
Outline
Outline
Section 4
(Answer all questions in this section)
6. The following defines a class keyword:
~tark
8. Select the declaration and initialization statement that will hold the letter J.
C01rect
int j=6,k=8,m=2,result;
result=j-k%3* m;
System .out. println( result);
6
0
-42
2 (* )
0 0
for Review
( 1) Points
int letter='J';
float letter='J';
String letter='J';
char letter='J'; (* )
Correct
00
1m
-
00
--
Provides the compiler information that identifies outside classes used within the current class.
Precedes the name of the class. (* )
o Defines where this class lives relative to other classes, and provides a level of access control.
...
34
1:
C01rect
St1ing name;
St>i ng Oracle="name";
St1ing name="name";
o St>i ng name="Oracle"; (* )
. ...
'l'
SnapShot: printscreen
Correct
~~~~~~~~~~~~~~~~~~
...__
U<U
_'Y_
._
._ . _- _UU
_
_____
RO ~ --:_ ~
I >C >l
13:34
r, ~ v
'='
. 16.05.2015
1H Facebook
TM
C) Student Sign In
[UO
C ~ I D ilea rning .o racle.com/ilearn/en/learner/jsp/playerJsp ?rco_id = 1340353197 &classroom_id = 1361817065&scorm_attem pt= 143176954275S&sessionld =4256988481L
+~
Outline
><
0
?
--
1m
-
Review your answers, feedback, and question scores below. An aste1isk (*) indicates a correct answer.
Section 4
(Answer all questions in this section)
11. What is printed by the following code segment?
2
3
4
1!1.. 0
...
34
~~~ert
~:~Ja~v~a~F~u~l~
l d~~~~~~
~~~l~s~f~il~l~
~~
~~------------------------------------------------------------------------------------------------------------------~
Outline
1:
\\\\
Section 6 - tmngArra'}5and
\\\\\\\ (*)
\\\\\\\\\\\\\\
\\
Correct
S t ring s = na b cdef";
4
5
6
e l se
Syst em. o ut . p rintl n ( "No t
Equal " );
True or false>
True (*)
False
Correct
~tark
for Review
( 1) Points
~tark
for Review
( 1) Points
= String( "Hello" );
True or false>
True
False (*)
Correct
. ...
'l'
~~~~~~~~~~~~~~~~~~
...__
U<U
_'Y_
._
._ . _- _UU
_ __ __ _
SnapShot: printscreen
The screen shot has succesfully been saved to disk
RO~
~
I IC >l
13:34
'
~ v
'='
. 16.05.2015
1H Facebook
TM
D Student Sign In
[UO
C ~ I D ilea rning .o racle.com/ilearn/en/ learner/jsp/playerJsp ?rco_id = 1340353197 &classroom_id = 1361817065&scorm_attem pt= 143176954275S&sessionld =4256988481L
+~
Outline
System.out.print l n ( "Equal" );
3
4
0
?
--
1m
True or false?
True (*)
False
...
34
el s e
5
6
Outline
1:
C01rect
String str
= String( "Hello" );
True
False (*)
00
0 0
Which of the following statements will change the length of s to the largest length?
s.trim()
s.replace("a", "aa")
s.substring(2)
s.toUpperCase()
None of the above will change the length of s. (*)
00
00
Conect
Conect
0 0
Section 5
(Answer all Questions in this section)
~tark
for Review
( 1) Points
It is a post-test loop.
It is a modified while loop that allows the program to run through the loop once before testing the boolean condition.
It continues looping until the condition becomes false.
All of the above. (*)
0
Previous
. ...
'l'
~ x
~~~~~~~~~~~~~~~~~~
SnapShot: p rintscreen
...__
U<U
_'Y_
._
._ . _- _UU
_
_____
RO~
~
I >C >l
13:34
'
~ v
'='
. 16.05.2015
1H Facebook
TM
C) Student Sign In
[ UO
C ~ I D ilea rning .o racle.com/ilearn/en/learner/jsp/playerJsp ?rco_id = 1340353197 &classroom_id = 1361817065&scorm_attem pt= 143176954275S&sessionld =4256988481L
+~
Outline
><
Outline
--
1m
A
Review your answers, feedback, and question scores below. An aste>isk (*) indicates a correct answer.
Section 5
(Answer all questions in this section)
16. All of the following are essential to initializing a for loop, except which one?
Correct
...
~~~ert
~:~Ja~v~a~F~u~l~
l d~~~~~~
~~~l~s~f~il~l~
~~
~~------------------------------------------------------------------------------------------------------------------~
1:
34
~lark
for Review
( 1) Points
5; 30; 5
3; 9; 11
~
C01rect
., < (*)
., <= (*)
., ! = (*)
Correct
~lark
for Review
( 1) Points
. ...
(*)
~ ~ -------
-----
- - - --------
------,
RO '"""
"""' .....
G I"
'='
>C ,;
13:34
16.05.2015
1H Facebook
TM
D Student Sign In
[UO
C ~ I D ilea rning .o racle.com/ilearn/en/ learner/jsp/playerJsp ?rco_id = 1340353197 &classroom_id = 1361817065&scorm_attem pt= 143176954275S&sessionld =4256988481L
+~
Outline
Outline
x* =3;
count-=3;
}
4;
3;
5;
5;
3;
8; 27
27; 8 (*)
27; 8
30; 5
9; 11
Correct
1:
...
34
0
?
--
1m
( 1) Points
., < (*)
., <= (*)
., ! = (*)
C01rect
Correct
2
3
4
String
s= (wo rds. length <words[l] . length( ))?wo rds [O] :words[1];
System.out.println ( s);
~lark
for Review
( 1) Points
5
True
False(* )
~
Previous
. ...
'l'
Correct
I Page 4 of 10 I Next I
Summary
~ x
~~~~~~~~~~~~~~~~~~
SnapShot: p rintscreen
...__
U<U
_'Y_
._
._ . _- _UU
_
_____
RO~
~
I >C >l
13:34
'
, ~ v
'='
. 16.05.2015
1H Facebook
TM
C) Student Sign In
[UO
C ~ I D ilea rning .o racle.com/ilearn/en/ learner/jsp/playerJsp ?rco_id = 1340353197 &classroom_id = 1361817065&scorm_attem pt= 143176954275S&sessionld =4256988481L
~
Outline
><
0 .
--
Outline
~~~ert
~:~Ja~v~a~F~u~l~
l d~~~~~~
~~~l~s~f~il~l~
~~
~~---------------------------------------------------------------------------------------------------------------------
Review your answers, feedback, and question scores below. An aste>isk (*) indicates a correct answer.
1~
Section 6
(Answer all questions in this section)
21. Big-0 Notation is used in Computer Science to desCiibe the pe1formance of Sorts and Searches on arrays. True or false>
True (*)
False
~lark
Correct
23. Binary searches can be pe>formed on sorted and unsorted data. True or false>
True
False (*)
C01rect
24. A sequntial search is an iteration through the a>ray that stops at the index where the desired element is found. True or false?
True (*)
False
for Review
( 1) Points
Correct
Correct
25. Which of the following declares and initializes a one dimensional array named words of size 3 so that all entries can be Strings?
G
Previous
Page 5 of 10
I Next I I Summary I
. ...
'l'
~ x
~~~~~~~~~~~~~~~~~~
SnapShot: p rintscreen
...__
U<U
_'Y_
._
._ . _- _UU
_ __ __ _
RO~
. ~
I >C >l
13:34
'
, ~ v
'='
. 16.05.2015
1H Facebook
TM
C) Student Sign In
[UO
C ~ I D ilea rning .o racle.com/ilearn/en/learner/jsp/playerJsp ?rco_id = 1340353197 &classroom_id = 1361817065&scorm_attem pt= 143176954275S&sessionld =4256988481L
+~
Outline
><
...
34
0
?
--
1m
-
~~~ert
~:~Ja~v~a~F~u~l~
l d~~~~~~
~~~l~s~f~il~l~
~~
~~------------------------------------------------------------------------------------------------------------------~
Review your answers, feedback, and question scores below. An aste1isk (*) indicates a correct answer.
Outline
1:
Section 6
(Answer all questions in this section)
26. What is the output of the following segment of code if the command line arguments are "a b c d e f'?
2
3
4
5
1
3
5
6 (*)
This code doesn't compile.
Correct
27. The following segment of code initializes a 2 dimensional array of primitive data types. True or false?
o True (*)
False
Conect
28. Which of the following declares a one dimensional array name scores of type int that can hold 14 values?
int scores;
Correct
1
2
~lark
t r y{
i f (x < 0)
for Review
( 1) Points
cat c h {
System .out.print l n("Enter your v alue again.")i
. ...
'l'
~~~~~~~~~~~~~~~~~~
...__
U<U
_'Y_
._
SnapShot: p rintscreen
~ x
7
-
._ . _- _UU
_ __ __ _
RO~
~
I IC >l
13:34
'
~ v
'='
. 16.05.2015
1H Facebook
TM
D Student Sign In
[UO
C ~ I D ilea rning .o racle.com/ilearn/en/ learner/jsp/playerJsp ?rco_id = 1340353197 &classroom_id = 1361817065&scorm_attem pt= 143176954275S&sessionld =4256988481L
~
Outline
~lark
Correct
28. Which of the following declares a one dimensional array name scores of type int that can hold 14 values?
int scores;
int[] scores=new int[14]; (* )
int[] scores=new scores int[14];
int score= new int[14];
for Review
( 1) Points
True (*)
False
--
1!1
0 .
Outline
27. The following segment of code initializes a 2 dimensional arrav of ptimitive data types. True or false?
1~
C01rect
2
3
4
5
6
7
t r y{
i f (x < 0 )
t hr ow new Exception ("Your a nswer i s nega t i ve")i
catch {
System. out.print l n ( "Enter your v alue a g ain.");
It is missing a semicolon.
It does not compile. (* )
It gives you an out of bounds exception.
There is nothing wrong with this code.
Conect
Section 7
(Answer all Questions in this section)
30. What operator do you use to call an object's constructor method and create a new object>
~lark
for Review
( 1) Points
+
new(* )
instanceOf
~
Previous
. ...
'l'
Correct
I Page 6 of 10 I Next I
Summary
~ x
~~~~~~~~~~~~~~~~~~
SnapShot: p rintscreen
...__
U<U
_'Y_
._
._ . _- _UU
_
_____
RO~
. ~
I >C >l
13:34
'
, ~ v
'='
. 16.05.2015
1H Facebook
TM
C) Student Sign In
[UO
C ~ I D ilea rning .o racle.com/ilearn/en/learner/jsp/playerJsp ?rco_id = 1340353197 &classroom_id = 1361817065&scorm_attem pt= 143176954275S&sessionld =4256988481L
+~
Outline
><
--
1m
A
Section 7
(Answer all questions in this section)
31. A class can only have one constructor. True or false>
True
False (*)
for Review
( 1) Points
~lark
for Review
( 1) Points
Correct
p ublic c la ss Th i sC la ss
priv a t e i nt a=4, b=S;
Th i sCla ss ( i n t x ) (
a=x *b ;
2
3
4
5
6
Conect
34. All objects, in Java, are created using int. True or false?
True
False (*)
~
...__
U<U
_'Y_
._
Correct
SnapShot: p rintscreen
~ x
~~~~~~~~~~~~~~~~~~
~lark
class Account{ ;
p>ivate int number;
p1ivate String name;;
public Account;
}
Correct
'l'
Review your answers, feedback, and question scores below. An aste>isk (*) indicates a correct answer.
. ...
...
34
~~~ert
~:~Ja~v~a~F~u~l~
l d~~~~~~
~~~l~s~f~il~l~
~~
~~------------------------------------------------------------------------------------------------------------------~
Outline
1:
._ . _- _UU
_ __ __ _
RO~
. ~
I >C >l
13:34
'
, ~ v
'='
. 16.05.2015
1H Facebook
TM
D Student Sign In
[UO
C ~ I D ilea rning .oracle.com/ilearn/en/ learner/jsp/playerJsp ?rco_id = 1340353197 &classroom_id = 1361817065&scorm_attem pt= 143176954275S&sessionld =4256988481L
+~
Outline
Outline
Correct
~tark
for Review
( 1) Points
~tark
for Review
( 1) Points
--
1m
Correct
34
...
class Account{ ;
private int number;
private String name;;
public Account;
}
1:
publ ic c lass Th i sC la ss
2
3
4
Th i sC la ss ( i nt x )
a=x ....b ;
5
6
Correct
34. All objects, in Java, are created using int. True or false?
True
False (*)
Correct
~tark
for Review
( 1) Points
True (*)
False
~
Previous
. ...
'l'
Correct
I Page 7 of 10 I Next I
Summary
~ x
~~~~~~~~~~~~~~~~~~
SnapShot: p rintscreen
...__
U<U
_'Y_
._
._ . _- _UU
_
_____
RO~
~
I >C >l
13:34
'
~ v
'='
. 16.05.2015
1H Facebook
TM
C) Student Sign In
[ UO
C ~ I D ilea rning .o racle.com/ilearn/enjlearner/jsp/playerJsp ?rco_id = 1340353197 &classroom_id = 1361817065&scorm_attem pt= 143176954275S&sessionld =4256988481L
+~
Outline
><
Outline
1:
...
35
0
?
--
1m
-
~~~ert
~:~Ja~v~a~F~u~l~
l d~~~~~~
~~~l~s~f~il~l~
~~
~~------------------------------------------------------------------------------------------------------------------~
Review your answers, feedback, and question scores below. An aste1isk (*) indicates a correct answer.
Section 7
(Answer all questions in this section)
36. Which of the following is the conect way to call an overriden method needOil() of a super class Robot in a subclass SqueakyRobot?
Robot.needOii(SqueakyRobot);
SqueakyRobot.needOil();
super.needOil(); (*)
needOii(Robot);
Correct
~lark
for Review
( 1) Points
Correct
38. Consider creating a class Square that extends the Rectangle class provided below. Knowing that a square always has the same width and length, which of the following best
represents a constructor for the Square class?
priv a t e i nt length;
priv a t e i nt width;
2
3
4
5
6
7
8
9
t h i s.co l o r=co l o r ;
3
4
5
1
. ...
'l'
~~---------------~
...__
U<U
_'Y_
._
._ . _- _UU
______
SnapShot: p rintscreen
~ x
RO ~
- ~
I C '
13:35
'
, ~ v
'='
. 16.05.2015
1H Facebook
TM
C) Student Sign In
[ UO
C ~ I D ilea rning .o racle.com/ilearn/enj learner/jsp/playerJsp ?rco_id = 1340353197 &classroom_id = 1361817065&scorm_attem pt= 143176954275S&sessionld =4256988481L
+~
Outline
...
35
0
?
Section 6 - tmngArraysand
length , i nt widt h ) {
t h i s.co l o r=color ;
2
3
4
5
--
1m
-
8
9
1!1.. 0
Outline
1:
s ize )
2
3
2
3
s i ze ) {
(* )
None of the above.
39. If a variable in a superclass is private, could it be directly accessed or modified by a subclass? Why or why not>
Yes. A subclass inherits full access to all contents of its super class.
Yes. Any variable passed through inheritance can be changed, but private methods cannot
No. A private variable can only be modified by the same class with which it is declared regardless of its inheritance. (* )
No. Nothing inherited by the super class can be changed in the subclass.
COITeCt
~tark
for Review
( 1) Points
True (*)
False
0
Previous
. ...
'l'
Page 8 of 10
I Next I I Summary I
~ x
~~---------------~
SnapShot: p rintscreen
...__
U<U
_'Y_
._
._ . _- _UU
_ __ __ _
RO ~
~
I >C >l
13:35
'
, ~ v
'='
. 16.05.2015
1H Facebook
TM
C) Student Sign In
[ UO
C ~ I D ilea rning .o racle.com/ilearn/en/learner/jsp/playerJsp ?rco_id = 1340353197 &classroom_id = 1361817065&scorm_attem pt= 143176954275S&sessionld =4256988481L
+~
Outline
><
--
1m
A
Section 7
(Answer all questions in this section)
41. Which of the following correctly defines overloading?
Having more than one constructor with different names and the same arguments.
A va1iable argument method that returns an array.
A type of access specifier that only allows access from inside the same class.
0 .. f) Java FundamentalsMidterm [
1!1..0 Secbon ~ - tmng Eclipse
Correct
~lark
Correct
43. Which segment of code represents a correct way to call a variable argument method counter that takes in integers as its variable argument parameter>
C01rect
45. Non-final static class variables should be private to prevent changes from other classes. True or false>
True (*)
False
~
...__
U<U
_'Y_
._
Correct
SnapShot: p rintscreen
~ x
~~~~~~~~~~~~~~~~~~
for Review
( 1) Points
Because you wish to be able to use that object inside of the method.
It has faster pe>formance than returning a primitive type.
The method makes changes to the object and you wish to continue to use the updated object outside of the method. (* )
None of the above. It is not possible to return an object.
'l'
Review your answers, feedback, and question scores below. An aste>isk (*) indicates a correct answer.
. ...
...
35
~~~ert
~:~Ja~v~a~F~u~l~
l d~~~~~~
~~~l~s~f~il~l~
~~
~~------------------------------------------------------------------------------------------------------------------~
Outline
1:
._ . _- _UU
______
RO ~
. ~
I >C >l
13:35
'
, ~ v
'='
. 16.05.2015
1H Facebook
TM
C)
Studen t Sign
In
[ UO
C ~ I D ilea rning .o racle.com/ilearn/en/learner/jsp/playerJsp ?rco_id = 1340353197 &classroom_id = 1361817065&scorm_attem pt= 143176954275S&sessionld =4256988481L
+~
Outline
><
0
?
--
1m
A
Review your answers, feedback, and question scores below. An aste>isk (*) indicates a correct answer.
Section 7
(Answer all questions in this section)
True
False (*)
...
35
~~~ert
~:~Ja~v~a~F~u~l~
l d~~~~~~
~~~l~s~f~il~l~
~~
~~------------------------------------------------------------------------------------------------------------------~
Outline
1:
Correct
47. Static classes can't return instances of the parent class when the parent class uses a private const>uctor. True or false?
~lark
for Review
( 1) Points
Section 6 - tmngArra'}5and
True
False (*)
48. If an abstract class does not have implemented constructors or methods, it should be implemented as an interface instead. True or false?
True (*)
False
C01rect
49. Would this code be co>rect if a Dog is a HousePet? Why or Why not?
HousePet Scooby
= new Dog();
Correct
. ...
';!
__
~~~~~~~~~~~~~~~~~~~~~~
- ~~~~~~~~-R
o_'""'
~s~
,....
~
. -.,.~~
G
~I"
-.~
.,
~,C,,~~
13
:3_
5 _'
...__
ueo
_'9_
'
- -
._ . _- _um_ _ _ _ _ _j
'='
16.05.2015
1H Facebook
TM
D Student Sign In
[ UO
C ~ I D ilea rning .o racle.com/ilearn/en/ learner/jsp/playerJsp ?rco_id = 1340353197 &classroom_id = 1361817065&scorm_attem pt= 143176954275S&sessionld =4256988481L
+~
Outline
...
48. If an abstract class does not have implemented constructors or methods, it should be implemented as an interface instead. True or false?
~tark
1m
for Review
( 1) Points
Correct
49. Would this code be correct if a Dog is a HousePet? Why or Why not?
--
True (*)
False
2 . tmngAlJCe 3
35
True
False (*)
1!1.... -
Outline
1:
Correct
~lark
for Review
(1) Points
Which of the following program segments in Test's client class will compile with no errors?
I only
I and III (* )
II only
II and III
I, II, and III
~
Previous
' ...
'l'
Correct
I Page 10 of 10 I Summary I
~ x
~~---------------~
SnapShot: p rintscreen
...__
U<U
_'Y_
._
._ . _ _UU
_
_____
RO ~
. ~
I >C >l
13:35
'
, ~ v
'='
. 16.05.2015