We will create an
AnimalProtocol protocol to specify the requirements that a type must meet in order to be considered an animal. Then, we will create an
Animal base class that conforms to this protocol, and then, we will specialize this class in three subclasses:
Lion. Then, we will create a
Party class that will be able to work with the instances of any class that conforms to the
AnimalProtocol protocol through generics. We will work with a party of dogs, a party of frogs, and a party of lions.
Then, we will create a
DeeJayProtocol protocol and generate a
HorseDeeJay class that conforms to this new protocol. We will create a subclass of the
Party class named
PartyWithDeeJay, which will ...