Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider the UML diagram below > Library A Extends Book CD + read() Which of the following snippet(s) of code will raise a compile-time error?

image text in transcribed
image text in transcribed
image text in transcribed
Consider the UML diagram below > Library A Extends Book CD + read() Which of the following snippet(s) of code will raise a compile-time error? Select all correct answers, Which of the following snippet(s) of code will raise a compile-time error? Select all correct answers. a) Library collection = new Book(); collection.read(); b) Library collection = new Book(); c) Library collection = new CD(); Book music = (Book) collection; d) Library collection = new CDO; CD music = collection; e) Library collection = new Library(); ((Book)collection).read(); f) Library collection = new CD(); System.out.println(collection.hashCode(); Question 3 (1 point) Assume that the following snippet of code compiles. Dessert[] yummy = new Dessert[4]; yummy [0] = new Cookie (); Cake C new Cake (); yummy [1] C; C = new Cookie (); yummy [2] yummy [3] new IceCream(); for (Food f : yummy) System.out.println( ((cookie) f).isDelicious()); C; Which of the following statements must be true? Select all correct answers. a) Dessert is a subtype of Food b) Dessert is an abstract class c) There are 3 objects of type Cookie in the array yummy d) Cookie is a subclass of Cake e) The class Food contains a method called isDelicious

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

Seven Databases In Seven Weeks A Guide To Modern Databases And The NoSQL Movement

Authors: Luc Perkins, Eric Redmond, Jim Wilson

2nd Edition

1680502530, 978-1680502534

More Books

Students also viewed these Databases questions

Question

=+How will this affect the recruiting process?

Answered: 1 week ago