Challenge: Visitor Pattern
In this challenge, you have to implement the visitor pattern to solve the given problem.
We'll cover the following...
Problem statement
In this challenge, you need to implement the visitor pattern to separate Rock
music from the other genres of music by creating a separate playlist. You need to implement the RockMusicVisitor
class for this purpose. As you can see, it contains the visit
method, which should return the rock music playlist.
Note: the rock music playlist only needs to contain the names ...