Message notifier as a thread

Report a typo

Write a service that takes a message and the number of its repetitions as constructor parameters and prints the message to the standard output the specified number of times.

Use the provided template for your class.

The testing system will start the service as a regular thread.

Sample Input 1:

Hello, Mary
3

Sample Output 1:

Hello, Mary
Hello, Mary
Hello, Mary
Write a program in Java 17
class MessageNotifier extends Thread {

// write fields to store variables here

public MessageNotifier(String msg, int repeats) {
// implement the constructor
}

@Override
public void run() {
// implement the method to print the message stored in a field
}
}
___

Create a free account to access the full topic