D
devphylosoff
hey
problem:
how invoke diffrent methods/contructors (depends on arguments number)
in one statement.
description:
I have many classes with constructors NameOfClass(int, int, int, ...,
int);
and I have method which invoke each of above class in switch block:
if (className == sth) {
NameOfClass1(int a, int b);
} else if (className == sth2) {
NameOfClass2(int a, int b, int c);
} else if ...
use ArrayList or another like solution is not acceptable.
is reflection will be helpful here ?
problem:
how invoke diffrent methods/contructors (depends on arguments number)
in one statement.
description:
I have many classes with constructors NameOfClass(int, int, int, ...,
int);
and I have method which invoke each of above class in switch block:
if (className == sth) {
NameOfClass1(int a, int b);
} else if (className == sth2) {
NameOfClass2(int a, int b, int c);
} else if ...
use ArrayList or another like solution is not acceptable.
is reflection will be helpful here ?