Is it possible to somehow define a constant that says which data type to use for certain variables, similar to generics? So in a particular class, I would have something like the following:
MYTYPE = System.String;
// some other code here
MYTYPE myVariable = "Hello";
From the principle, it should do the same as generics, but I do not want to write a data type every time the constructor for this class is called. It should simply ensure that the same data type is used for two (or more) variables.
source
share