In Java 1. Which term best describes a \"A uses B\" class relationship? word answer: 2. choose correct...

70.2K

Verified Solution

Question

Programming

In Java
1. Which term best describes a \"A uses B\" class relationship? wordanswer:

2. choose correct one:

What are some of the ways a class can exhibit dependency?

A. A class can invoke the methods of another class.

B. A method within a class can accept an object of the sameclass.

C. A class can rely on a constant defined in another class.

D. All of the above.

Which if the following statements is FALSE regarding arrays ofobjects?

A. Objects stored in an array are automatically instantiatedwhen the array is created.

B. Attempting to print out an empty array of objects willgenerate a NullPointerException.

C. An array of objects initially holds null references.

D. An array of objects is actually an array of references to theobjects.

What symbol changes a typical parameter to a variable parameterlist?

A :

B *

C ...

D ?

Which of the following rules is TRUE regarding variableparameter lists?

A. A variable parameter list can appear in any order in a listof formal arguments.

B. A method can only have one variable parameter list in itslist of formal parameters.

C. A variable parameter list can be the only formal argument ina method.

D. You cannot use a variable parameter list in aconstructor.

3. Fill in the Blanks

The keyword [_____] is used to establish an inheritancerelationship.

The existing class is also known as the [_____] class.

4. When should the protected modifier be used?

A. When you want all classes to access variables or methods fromany other classes.

B. When you want a derived class to access a variable or methodfrom the (originally) existing class.

C. When you don't want any variable or method to be accessibleoutside the class.

D. When you want a single method or variable to be shared amongall objects.

5. The super reference is typically used by the child class tocall which type of method? Word Answer:

6. Fill in the Blanks

A new method must have the same [_____] as the existing methodin order to perform overriding..

Answer & Explanation Solved by verified expert
4.0 Ratings (610 Votes)
thanks for the question here are the answers 1 extends example Class A extends B 2 Option A is not correct if a class can invoke the methods of another class then there is no dependency Option B is correct by accepting an object    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students