I got something like this:
public [What Here?] GetAnything()
{
Hello hello = new Hello();
Computer computer = new Computer();
Radio radio = ne
To build on the answer by @RQDQ using generics, you can combine this with Func
(or some variation) and delegate responsibility to the caller:
public T GetAnything(Func createInstanceOfT)
{
//do whatever
return createInstanceOfT();
}
Then you can do something like:
Computer comp = GetAnything(() => new Computer());
Radio rad = GetAnything(() => new Radio());