You are on page 1of 2

1) Create a class called Book with the following details.

Book

id String
title String
author String
price float
date_of_publication date

Create the default and parameterized constructor.


Create the setter and getter properties as required.

Create a Main class with main method to test the code.


check two books are equal basis of author name

Use the input as string

Testcase1
Enter the details of object1
B0001;Java;Patrick;500.39;2016-10-11
Enter the detaiils of object2
B0002;C;Patrick;400.56;2016-05-12
The details of Book1
CODE: B0001
TITLE: Java
AUTHOR: Patrick
PRICE: 500.39
DATE_OF_PUBLICATION: 11-OCT-2016
The details of Book2
CODE: B0002
TITLE: C
AUTHOR: Patrick
DATE_OF_PUBLICATION: 12-MAY-2016

Both the books have same author


-----------------------------------------------------------------------------------
----------------------

Testcase2
Enter the details of object1
B0001;Java;Patrick;500.39;2016-10-11
Enter the details of object2
B0002;C;John;400.56;2016-05-12
The details of Book1
CODE: B0001
TITLE: Java
AUTHOR: Patrick
PRICE: 500.39
DATE_OF_PUBLICATION: 11-OCT-2016
The details of Book2
CODE: B0002
TITLE: C
AUTHOR: Patrick
DATE_OF_PUBLICATION: 12-MAY-2016

The authors are different


-----------------------------------------------------------------------------------
--------------

You might also like