Difference generics - abstract base class
Hello. I am trying to do the following: Write a program that does different string encryption. I want to use a builder pattern, so that I can extend the program with more encryption schemes. There will be a "context" class that does the string adding and such but does not know how to encrypt. That is extended by the concrete encryption class that comes from the builder (if I understand that correctly, that is called a "strategy pattern"). Attached is a code that should give you an idea of how it will look like. the question I have is the difference in the two "Context" classes - one is generic, the other uses an abstract type. To me, it seems generics only make things more complicated, but maybe there is something that I don't know about. It would be helpful if someone could point out the differences, and which approach I should choose (and why). Thank you! Here is the code: https://code.sololearn.com/c1ix8UMbZsbE