CSE 2221 MIDTERM 2 LATEST
EXAM
Uninitialized reference variable - ANSWERS-A reference variable
which has been created but hasn't been assigned a value
Anonymous reference variable - ANSWERS-A literal, which has an
object value but no name
Aliasing - ANSWERS-When two or more reference variables point to
the same object (causes problems when one attempts to change the
object)
Parameter passing - ANSWERS-Copies reference values
Comparing variables - ANSWERS-"==" compares reference values,
.equals() compares object values
Array - ANSWERS-A group of similar variables all of the same type, a
reference type
Array element - ANSWERS-Each acts like a single variable of the
declaration type
END OF
PAGE
1
, CSE 2221 MIDTERM 2 LATEST
EXAM
Recursive method - ANSWERS-A method that calls itself
Implements - ANSWERS-If a class implements an interface then it
contains the method bodies for the behaviors specified in the interface
Extends - ANSWERS-Can use all methods from the superclass, can
override and modify methods as well
Precondition - ANSWERS-characterizes the responsibility of the
program
that calls the method (the client)
Post-condition - ANSWERS-characterizes the responsibility of the
program that implements the method (the implementer)
Parameter Mode - ANSWERS-Part of the contract that specifies the way
a method might change the value of the corresponding argument.
END OF
PAGE
2
EXAM
Uninitialized reference variable - ANSWERS-A reference variable
which has been created but hasn't been assigned a value
Anonymous reference variable - ANSWERS-A literal, which has an
object value but no name
Aliasing - ANSWERS-When two or more reference variables point to
the same object (causes problems when one attempts to change the
object)
Parameter passing - ANSWERS-Copies reference values
Comparing variables - ANSWERS-"==" compares reference values,
.equals() compares object values
Array - ANSWERS-A group of similar variables all of the same type, a
reference type
Array element - ANSWERS-Each acts like a single variable of the
declaration type
END OF
PAGE
1
, CSE 2221 MIDTERM 2 LATEST
EXAM
Recursive method - ANSWERS-A method that calls itself
Implements - ANSWERS-If a class implements an interface then it
contains the method bodies for the behaviors specified in the interface
Extends - ANSWERS-Can use all methods from the superclass, can
override and modify methods as well
Precondition - ANSWERS-characterizes the responsibility of the
program
that calls the method (the client)
Post-condition - ANSWERS-characterizes the responsibility of the
program that implements the method (the implementer)
Parameter Mode - ANSWERS-Part of the contract that specifies the way
a method might change the value of the corresponding argument.
END OF
PAGE
2