PRO192_-_PE01_-_SU_2025_4004.webp
white_cloud1

PRO192_-_PE01_-_SU_2025_4004.webp

☑Kizspy.me
-id: int
- title: String
author: String
+ Book()
+ Book(id: int, title: String, author: String)
+ setters & getters
+toString():String
Book(id: int, title: String, author: String) - a
parameterized constructor that sets values
for id, title, and author
⚫ setters & getters: write the setters and getters
for the fields. The getTitle() method should
return the title in uppercase.
Override toString(): String - returns a string
format that contains all the information of
the Book: id, title, author.
Write a class BookList which extends from ArrayList (ArrayList is a collection) with the following
information:
BookList
+addBook(book: Book): void
+getTitleById(id: int): String
+getBookListBy Author(author: String):
BookList
Where:

.
addBook(book: Book): void Add a new
Book to the BookList collection.
getTitleByld(id:int): String - return the title
in uppercase of the book by id. If the id
does not exist, return "N/A".
getBookListByAuthor(author:String):
BookList return a list of books by the
specified author (case insensitive) if
found, otherwise return null.
Zoom
Hints: to declare the BookList class, you can use the following statement:
public class BookList extends ArrayList<Book> { //.....}
+ 100%
Close
Chưa có bình luận nào.

Thông tin

Category
PRO192
Thêm bởi
white_cloud1
Ngày thêm
Lượt xem
2,504
Lượt bình luận
0
Rating
0.00 star(s) 0 đánh giá

Share this media

Back
Bên trên Bottom