CMSC 132 Midterm 1 Exam Questions With 100% Correct Answers | Verified | Latest Update
Provide an example that illustrates procedural abstraction - ANSOne example: a function that sorts data, but we don't indicate how to sort it. the private access specifier - ANSMention one Java language feature that allow us to implement encapsulation. Yes, as finalize() is called when an object is garbage collected - ANSYou would like to generate a message when an object is garbage collected. Would you be able to generate that message using the finalize() method? Briefly explain When you have a fixed number of instances (e.g., phases of the moon). - ANSshould you use an enumerated type vs. a class? Briefly explain. Both the View and Controller. - ANSFor our first project (ClearCellGame) which component (of the Model-View-Controller) was provided? Using static defines a single constant for the whole class, whereas non-static defines a constant per object. - ANSWhat is difference between making a variable final static vs. just final? In other words, what is the difference between the following two declarations? Briefly explain. Throw illegal argument exception with a string "Invalid Argument" - ANSthrow new IllegalArgumentException("Invalid Argument");
Written for
- Institution
- CMSC 132
- Course
- CMSC 132
Document information
- Uploaded on
- July 3, 2024
- Number of pages
- 3
- Written in
- 2023/2024
- Type
- Exam (elaborations)
- Contains
- Questions & answers
Subjects
-
cmsc 132 midterm 1 exam questions with 100 correc