184k views
0 votes
A student has created a Book class. The class contains variables to represent the following.An int variable called pages to represent the number of pagesA boolean variable called isHardcover to indicate whether or not the book is hardcoverThe object story will be declared as type Book.Which of the following descriptions is accurate?a- An instance of the story class is Book.b- An instance of the Book object is story.c- An attribute of the story object is isHardcover.d- An attribute of the pages object is Book.e- An attribute of the Book instance is story.

User Haakonkas
by
4.5k points

1 Answer

1 vote

Answer:

Option c An attribute of the story object is isHardcover

Step-by-step explanation:

Given a book class that contains a boolean variable isHardcover. This is considered as an instance variable that will be available to all book object. Since the object story is declared as type Book and therefore it possesses the instance variable, isHardcover. The instance variable in an object is also termed as attribute which is a data component of the object.

User Andrew Patterson
by
5.2k points