CSE 2221 Midterm 2 exam solved 100%
CSE 2221 Midterm 2 exam solved 100% Precondition -Correct Answer-characterizes the responsibility of the program that calls the method (the client) Post-condition -Correct Answer-characterizes the responsibility of the program that implements the method (the implementer) Parameter Mode -Correct Answer-Part of the contract that specifies the way a method might change the value of the corresponding argument. Clears -Correct Answer-A parameter mode. Upon returning from a method call, a clears-mode parameter has the initial value for its type. Restores -Correct Answer-The default parameter mode. Upon returning from a method call, a restores-mode parameter has the value it had when it was passed into the method. Replaces -Correct Answer-A parameter mode. Upon returning from a method call, a replaces-mode parameter may have a different value than its incoming value, but the method's behavior doesn't depend on the incoming value of the parameter. Testing -Correct Answer-Proving code has an error Debugging -Correct Answer-Finding and fixing an error in the code Receivers -Correct Answer-Distinguished formal parameters, implicit arguments Overloading -Correct Answer-Having methods/variables all with the same name. The actual constructor is inferred by the program from the argument type. .copyFrom() -Correct Answer-Copies values not references .newInstance() -Correct Answer-Has the advantage that you don't need to know the name of any implementation class to call the method
Written for
- Institution
- CSE 2221
- Module
- CSE 2221
Document information
- Uploaded on
- May 16, 2024
- Number of pages
- 7
- Written in
- 2023/2024
- Type
- Exam (elaborations)
- Contains
- Questions & answers
Subjects
-
precondition
-
post condition
-
parameter mode
-
reference types