CMSC132 Final study PT A(Correct answers)
What is an "instance" member? correct answers a member that belongs to an Instance of an object What is a "static" member? correct answers member that belongs to the class itself and does not require an instance of an object True/False: a. A class can implement numerous interfaces. b. Interfaces are useful for inheritance. c. Interfaces are useful for polymorphism. d. A class implementing an interface must implement... i. The public methods in the interface. ii. Methods in the interface that are not implemented in other classes iii. All methods in the interface. e. You cannot instantiate an interface directly. f. An interface can be used as a type for a variable. g. An interface can be used as the type for a "polymorphic collection". correct answers a. T b. F c. T d. i. T ii. F iii. F e. T f. T g. T Give an example of autoboxing. correct answers Integer a = 7; 7. Give an example of auto-unboxing. correct answers Integer x = new Integer(7); int y = x + 2; Write a statement that creates an empty ArrayList of String references using generic notation correct answers ArrayListString list = new ArrayList(); What is data abstraction? correct answers only the essential details are displayed to the user. The trivial or the non-essentials units are not displayed. Achieved by interfaces and abstract classes. Hide what data structures are used What is procedural abstraction? correct answers each method has a coherent conceptual description that separates its implementation from its users. Methods are encapsulated What is encapsulation? correct answers Surrounding something, not just to keep the contents together, but also to protect those contents. Restricts access to the inner
Document information
- Uploaded on
- May 29, 2024
- Number of pages
- 8
- Written in
- 2023/2024
- Type
- Exam (elaborations)
- Contains
- Questions & answers