A new rockstar game

Report a typo

Imagine that Rockstar releases the same game twice. What will be the reaction of fans?

You must implement the Observers pattern and predict their reaction!

Please, do not change the provided code of the classes.

Sample Input 1:

GTA 5
GTA 5

Sample Output 1:

Notification for gamer : Garry Rose
Garry Rose says : "Oh, Rockstar releases new game GTA 5 !"
Notification for gamer : Peter Johnston
Peter Johnston says : "Oh, Rockstar releases new game GTA 5 !"
Notification for gamer : Helen Jack
Helen Jack says : "Oh, Rockstar releases new game GTA 5 !"
Notification for gamer : Garry Rose
What? They've already released this game ... I don't understand
Notification for gamer : Peter Johnston
What? They've already released this game ... I don't understand
Notification for gamer : Helen Jack
What? They've already released this game ... I don't understand
Write a program in Java 17
import java.util.*;

/**
* Observable interface
**/
interface Observable {
// write your code here ...
}

/**
* Concrete Observable - Rockstar Games
**/
class RockstarGames implements Observable {

public String releaseGame;

// write your code here ...

public void release(String game) {
this.releaseGame = game;
// write your code here ...
}
}

/**
* Observer interface
**/
interface Observer {
// write your code here ...
}

/**
* Concrete observer - Gamer
**/
class Gamer implements Observer {

___

Create a free account to access the full topic