Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1. Applications can reuse existing classes using inheritance and composition. Inheritance represents relationship and composition represents relationship between classes. Inheritance reuses existing classes by extending
1. Applications can reuse existing classes using inheritance and composition. Inheritance represents relationship and composition represents relationship between classes. Inheritance reuses existing classes by extending the class. Composition reuses existing classes by referencing to the objects of the reused classes. 2. Answer true or false. A final local variable can be initialized when the variable is declared or before its first use anywhere in the method after it is declared A final instance variable can be initialized when the variable is declared or before its first use in any of the methods in the class. A final method can be overridden, but can be overloaded. A final class cannot be extended. a. b. c. d. 3. Which superclass members are inherited by all subclasses of that superclass? a. b. c. d. private instance variables and methods protected instance variables and methods private constructors protected constructors 4. The default equals method implementation of class Object determines a. b. c. d. whether two references refer to the same object in memory whether two references have the same type whether two objects have the same instance variables whether two objects have the same instance variable values 5. Which of the following statements about abstract class is true? a. abstract superclasses may contain instance variables. b. abstract superclasses may not contain implementations of methods. c. abstract superclasses must declare all methods as abstract. d. abstract superclasses must declare oll data members not given values as abstract e If a superclass declares an abstract method, a subclass must implement that method f An abstract class cannot be instantiated 6. involves using a superclass variable to invoke methods on superclass and subclass objects, enabling you to "program in the general. 7. Which statement best describes the relationship between superclass and subclass types? a. A subclass reference cannot be assigned to a superclass variable and a superclass reference cannot be
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started