Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribedimage text in transcribed

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 cannot 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 are true? Select all correct answers. a. b. c. d. e. f. abstract superclasses may contain instance variables. abstract superclasses may not contain implementations of methods. abstract superclasses must declare all methods as abstract. abstract superclasses must declare all data members not given values as abstract If a superclass declares an abstract method, a subclass must implement that method 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beyond Big Data Using Social MDM To Drive Deep Customer Insight

Authors: Martin Oberhofer, Eberhard Hechler

1st Edition

0133509796, 9780133509793

Students also viewed these Databases questions

Question

different betwwen istribute database system and parallel system

Answered: 1 week ago