Which option enables the code to compile?

Given:
And given the code fragment:

Book book1 = new EBook ();
Book1.readBook();
Which option enables the code to compile?

Given:
And given the code fragment:

Book book1 = new EBook ();
Book1.readBook();
Which option enables the code to compile?

A.
Option A

B.
Option B

C.
Option C

D.
Option D



Leave a Reply 7

Your email address will not be published. Required fields are marked *


rfvc

rfvc

D, because do Book book1 = new EBook(); if was A not is posible do a instance of Ebook because is a abstract class.

Bob

Bob

D, if you make eBook abstract then Book book1 = new EBook (); will not compile due to trying to create object from an abstract class.