Write a Java public static general method that doesn't belong to the Queue class(assuming the Queue type is Book and Book has a clone method, Book also has a method called getGenre() which returns the genre of the book):
Write a Java public static general method that doesn't belong to the Queue class(assuming the Queue type is Book and Book has a clone method, Book also has a method called getGenre() which returns the genre of the book):
Queue findOneGenreBooks(Queue Q, String genreType) that searches in the first parameter Q for all books that has the same genre type as defined by the second parameter genreType, return all of the books that have the specified genre type as a Queue. (For example, you may want to find all cartoon books and return them as a Queue). Please note: You are only allowed to use the Queue class which has constructors, enqueue, dequeue, front, isEmpty, size, toString, and clone methods.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images