Question: Class Book has instance data members ( all private ) String title, String author, int pages, double price. has a public static int variable named
Class Book
has instance data members all private String title, String author, int pages, double price.
has a public static int variable named numBooks with an initial value of zero.
has a parameterized constructor that will be used to make a Book object and assign values to its data members, and increment numBooks.
has a noarg constructor that increments numBooks.
has getters and setters for all instance data members.
has a toString method that returns a string displaying the state of a Book instance.
Use the numBooks variable to report the number of books instantiated.
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
