Question: OOP TASK java language, pls solve this fast Task 23: Interface Aim: To specify common behavior for objects using interfaces, and to define interfaces and

Task 23: Interface Aim: To specify common behavior for objects using interfaces, and to define interfaces and define classes that implement interfaces. Title: interface Relation, and Class Book. Summary: be familiar with interface. Question: In this task, write a complete java codes that implement the following UML class diagram: > Relation +relation (o: Object): boolean Book -author: String -title: String - id:int To Do: +overloaded constructors To Do: setters To Do: +getters To Do: +show (): void To Do: +relation (o: Object): boolean In class Book write: 1. Two constructors: 1. One with two parameters (full parameter constructor) title and author that do the following: - Assigns the title and author with suitable parameters. Increments id by one. One with a single parameter (title) that assigns: The title with suitable parameter. The author with "unknown". Increments id by one. 2. The setter methods that set the title and author. 3. The getter methods that return title, author, and id. 4. The relation (o: Object) method that compares the current Book object with the received Book object and returns true if both objects have the same title and author properties, and false otherwise. 5. The show () method that prints all the information of the Book. In the main method 1. Declare two objects of class Book. 2. Allow the user to enter their information. 3. Display the information of the two books. 4. Print if they are equal or not
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
