ASSIGNMENT 3 QUESTIONS AND WITH
VERIFIED ANSWERS GRADE A+
Which is the key word used to import a class?
Select one:
A. use
B. assume
C. link
,D. import - ANSWER - D. import
Which symbol indicates that a member is private a UML diagram?
Select one:
A. -
B. +
C. #
D. * - ANSWER - A. -
For the following code, which statement is not true?
public class Circus
{
private double radius;
public double x;
private double y;
}
Select one:
A. The x field is available to code that is written outside the Circle class.
B. The radius, x, and y fields are members of the Circle class.
C. The radius field is not available to code written outside the Circle
class.
, D. The y field is available to code written outside the Circle class. -
ANSWER - D. The y field is available to code written outside the Circle
class.
Data hiding (which means that critical data stored inside the object is
protected from code outside the object) is accomplished in Java by
Select one:
A. using the private access specifier on the class fields.
B. using the private access specifier on the class methods.
C. using the private access specifier on the class definition.
D. using the public access specifier on the class methods. - ANSWER -
C. using the private access specifier on the class fields.
When an argument is passed by value
Select one:
A. changes can be made to the argument variable.
B. the parameter variable holds the address of the argument.
C. the parameter variable holds a copy of the value passed to it.
D. the parameter variable cannot be changed. - ANSWER - B. the
parameter variable holds the address of the argument.
VERIFIED ANSWERS GRADE A+
Which is the key word used to import a class?
Select one:
A. use
B. assume
C. link
,D. import - ANSWER - D. import
Which symbol indicates that a member is private a UML diagram?
Select one:
A. -
B. +
C. #
D. * - ANSWER - A. -
For the following code, which statement is not true?
public class Circus
{
private double radius;
public double x;
private double y;
}
Select one:
A. The x field is available to code that is written outside the Circle class.
B. The radius, x, and y fields are members of the Circle class.
C. The radius field is not available to code written outside the Circle
class.
, D. The y field is available to code written outside the Circle class. -
ANSWER - D. The y field is available to code written outside the Circle
class.
Data hiding (which means that critical data stored inside the object is
protected from code outside the object) is accomplished in Java by
Select one:
A. using the private access specifier on the class fields.
B. using the private access specifier on the class methods.
C. using the private access specifier on the class definition.
D. using the public access specifier on the class methods. - ANSWER -
C. using the private access specifier on the class fields.
When an argument is passed by value
Select one:
A. changes can be made to the argument variable.
B. the parameter variable holds the address of the argument.
C. the parameter variable holds a copy of the value passed to it.
D. the parameter variable cannot be changed. - ANSWER - B. the
parameter variable holds the address of the argument.