Question: A student has created a Book class. The class contains instance variables to represent the following. An int variable called pages to represent the number
A student has created a Book class. The class contains instance variables to represent the following.
An int variable called pages to represent the number of pages
A boolean variable called isHardcover to indicate whether the book is hardcover
Book has a constructor
public Bookint pages, Boolean isharaaver
implementation not shown
The client class makes the declaration
Book story new Book true
Which one of the following descriptions is accurate?
An attribute of the object referenced by story is Book.
Book is an object, and story refers to a class
story refers to an instance of the class Book and Book is a primitive data type.
Book is static, and story refers to an object.
story refers to an instance of the class Book and pages is an attribute of the object referred to by story.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
