NotifictionService represents a common service interface for sending data to a different system:
public interface NotificationService { boolean sendNotification(String message, String recipient);}
The previous interface defines a method signature for sendNotification() by passing the message and recipient details and returning the type as Boolean. SMSService.java is a concrete implementation of this interface for sending SMS notifications:
public class SMSService implements NotificationService { public boolean sendNotification(String message, String recipient) { // Code for sending SMS System.out.println("SMS message has been sent to " + recipient); return true; }}
The previous class implemented code for sending SMS by ...