CPSC 2150 (FINAL EXAM) All Answers Are Correct 100%.
Who is responsible for making sure that the precondition of a function is met? correct answers The client that calls the function Who is responding for making sure that the postcondition of a function is met? correct answers The implementers of the function At which time is it safe to assume that the invariant of a class is true? correct answers After the constructor for the object has completed At the beginning of a public method After a public method has finished Which data types can be the declared type of a variable in java correct answers Interface, Extended Interface, Class, Abstract Class, Extended Class (I.E a class that extends inherits from another class) Which data type can be the dynamic type of a variable in java ( syntactically, not best practice ) correct answers Class Extended Class Which of the following can be in an interface file correct answers Public default methods Public abstract methods Public static final variables Which of the following can be in an abstract class correct answers Private variables Private methods (all) Public methods (all) Public abstract methods Public Variables (all) Static Methods Public static final variables Public static methods A _________________ can implement a _________________. correct answers Class, Interface Abstract class, Interface A __________________ can extend an _______________________. correct answers They have to be of the same type Interface, Interface Class, Class Class, Abstract Class You have a class called MyUtil that has a member function called myAverage that takes in an array and returns the average of the values in the array. In another code file and package you call myAverage on an array call arr with: double avg = MyUAverage(arr);
Written for
- Institution
- CPSC 2150
- Course
- CPSC 2150
Document information
- Uploaded on
- March 25, 2024
- Number of pages
- 5
- Written in
- 2023/2024
- Type
- Exam (elaborations)
- Contains
- Questions & answers
Subjects
-
who is responsible for making sure that the precon
Also available in package deal