MNO2608 Assignment 3 (100%
COMPLETE ANSWERS) Semester 1 2025
(WRITTEN)
"Shadowing" is the term used to describe how the field name is hidden by the name of a
local or parameter variable.
Select one:
True
False - <<<<ANSWERS>>>True
A constructor
Select one:
A. has the return type of void.
B. has the same name as the class.
C. always accepts two arguments.
D. always has a private access specifier. - <<<<ANSWERS>>>B. has the same name
as the class.
What is the following statement an example of?
import java.util.*;
Select one:
A. an unconditional import statement
B. a wildcard import statement
C. a conditional import statement
D. an explicit import statement - <<<<ANSWERS>>>B. a wildcard import statement
After the header, the body of the method appears inside a set of
Select one:
A. double quotes, " "
B. parentheses, ( )
C. brackets, [ ]
D. braces, { } - <<<<ANSWERS>>>D. braces, { }
A method
Select one:
A. may not have only one parameter variable.
B. never has parameter variables.
C. may have zero or more parameters.
, D. must have at least two parameter variables. - <<<<ANSWERS>>>C. may have zero
or more parameters.
For the following code, which statement is not true?
public class Circus
{
private double radius;
public double x;
private double y;
private double z;
}
Select one:
A. The radius field is not available to code written outside the Sphere class.
B. The x field is available to code that is written outside the Sphere class.
C. The z field is available to code written outside the Sphere class.
D. The radius, x, y, and z fields are members of the Sphere class. -
<<<<ANSWERS>>>C. The z field is available to code written outside the Sphere class.
It is common practice in object-oriented programming to make all of a class's
Select one:
A. methods private.
B. fields public.
C. fields and methods public.
D. fields private. - <<<<ANSWERS>>>D. fields private
You should not define a class that is dependent on the values of other class fields
Select one:
A. because it is redundant.
B. in order to keep it current.
C. in order to avoid having stale data.
D. because it should be
Which is the key word used to import a class?
Select one:
COMPLETE ANSWERS) Semester 1 2025
(WRITTEN)
"Shadowing" is the term used to describe how the field name is hidden by the name of a
local or parameter variable.
Select one:
True
False - <<<<ANSWERS>>>True
A constructor
Select one:
A. has the return type of void.
B. has the same name as the class.
C. always accepts two arguments.
D. always has a private access specifier. - <<<<ANSWERS>>>B. has the same name
as the class.
What is the following statement an example of?
import java.util.*;
Select one:
A. an unconditional import statement
B. a wildcard import statement
C. a conditional import statement
D. an explicit import statement - <<<<ANSWERS>>>B. a wildcard import statement
After the header, the body of the method appears inside a set of
Select one:
A. double quotes, " "
B. parentheses, ( )
C. brackets, [ ]
D. braces, { } - <<<<ANSWERS>>>D. braces, { }
A method
Select one:
A. may not have only one parameter variable.
B. never has parameter variables.
C. may have zero or more parameters.
, D. must have at least two parameter variables. - <<<<ANSWERS>>>C. may have zero
or more parameters.
For the following code, which statement is not true?
public class Circus
{
private double radius;
public double x;
private double y;
private double z;
}
Select one:
A. The radius field is not available to code written outside the Sphere class.
B. The x field is available to code that is written outside the Sphere class.
C. The z field is available to code written outside the Sphere class.
D. The radius, x, y, and z fields are members of the Sphere class. -
<<<<ANSWERS>>>C. The z field is available to code written outside the Sphere class.
It is common practice in object-oriented programming to make all of a class's
Select one:
A. methods private.
B. fields public.
C. fields and methods public.
D. fields private. - <<<<ANSWERS>>>D. fields private
You should not define a class that is dependent on the values of other class fields
Select one:
A. because it is redundant.
B. in order to keep it current.
C. in order to avoid having stale data.
D. because it should be
Which is the key word used to import a class?
Select one: