Question 3:
3 of 3
Paper No: 3
(3 marks) Write a class Book with the following information:
Book
-author:String
-page:int
Where:
•
•
getAuthor():String - return author.
getPage():int-return page.
+Book (

setAuthor(author:String): void - update author.
+Book (author:String, page:int)
•
setPage(page:int): void - update page.
+getAuthor():String
+getPage():int
+setAuthor(author:String):void
+setPage(page:int):void
The interface IBook below is already compiled and given in byte author format, thus you can use it
without creating IBook.java file.
import java.util.List;
public interface IBook {
public int fl(List<Book> t);
public void f2(List<Book> t);
public void f3(List<Book> t);
Zoom
- FUO
Write a class MyBook, which implements the interface IBook. The class MyBook implements methods
+ 100%
Close