CPSC 2150 Final Exam || with 100% Correct Answers.
Who is responsible for making sure that the precondition of a method is met? correct answers The client that calls the method Who is responsible for making sure that the postcondition of a method is met? correct answers The implementer of the method At which times 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 Which data types can be the dynamic type of a variable in Java? 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 Any type of private method Any type of public method Any type of public variables static methods public static final variables private static methods Public default methods public abstract methods NO CONSTRUCTORS A ____________ can implement a __________ correct answers A CLASS can implement an INTERFACE An ABSTRACT CLASS can implement an INTERFACE A _____________ can extend a __________ correct answers Interface, interface class, class class, abstract class You have a class called MyUtil that has a method 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 called arr with: double avg = MyUAverage(arr);
Written for
- Institution
- CPSC 2150
- Course
- CPSC 2150
Document information
- Uploaded on
- March 25, 2024
- Number of pages
- 6
- 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