I know it\'s not possible to define a constructor in an interface. But I\'m wondering why, because I think it could be very useful.
So you could be sure that some fi
If you want to make sure that every implementation of the interface contains specific field, you simply need to add to your interface the getter for that field:
interface IMyMessage(){
@NonNull String getReceiver();
}
Receiver
object has to be passed to the class in some way (either by constructor or by setter)