Question: 1 . Consider the Book class that you wrote in Worksheet 4 . Here, you are asked to implement the BookNode class which will hold
Consider the Book class that you wrote in Worksheet Here, you are asked to implement the BookNode class which will hold Book objects. The BookNode class has the following members:
A private instance variable data of type Book
A private instance variable link of type BookNode
A constructor which takes two parameters of type Book and BookNode to initialize the private instance variables.
Public getter and setter methods for each private instance variable
Create a driver class named BookNodeDriver.
Inside the main method inside the driver class, declare two Book objects named myBook yourBook with the following characteristics:
myBook: title How to Catch a Dinosaur year isNewtrue
yourBook: title I am Enough year isNewfalse
Inside the main method inside the driver class, declare two objects of type BookNode named nodeA and nodeB with the following characteristics:
nodeA: data myBook, link null
nodeB: data yourBook, link null
Add two additional BookNode objects of your choice
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
