Answer the question
In order to leave comments, you need to log in
How to pass a dynamic parameter and instantiate it?
There are several classes with the same constructors - let's call them Adapters. I want to create a Loader class that would take one of the Adapters as input and create an instance of it by filling in the parameters. How to do this please tell me.
Answer the question
In order to leave comments, you need to log in
An adapter is a pattern that allows you to convert one interface to another.
ClassLoader is a special Java class that loads other Java classes into memory.
To create objects of different types depending on the conditions, use the Factory Method or Abstract Factory.
In general, learn to call a spade a spade and immediately everything falls into the right place.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question