I'm doing an exercise in Java on Singletons and I have to use the cls parameter in order to complete it. I'm very new to Java and haven't come across this yet.
public class Speakerphone extends Object{
public void shoutMessage()
I have to do the following to complete the code. How do I utilize the cls parameter to finish this off?
- shoutMessage
- Sends the message to all of the Listeners which are instances of the cls parameter
@param talker a Talker whose message will be sent (Talker)
@param cls a Class object representing the type which the Listener should extend from in order to receive the message (Class)
@return nothing