I want to instantiate a class by the value of a String. I found several tutorials that show several methods for doing this. The class MUST inherit from a certain interface
You can shorten it a bit like
ImplementMe a = (ImplementMe) Class .forName("my.package.IImplementedYou") .newInstance();
but you can't get rid of the cast. There may be a way to avoid the cast, but only if you can avoid the subproblem of loading class by name.