S
studentoflife77
Hello all,
a primitive question
I receive an object var which is of the type Object
then to verify its type i write following code
if (var instance of X)
.... do something
if (var instance of Y)
.... do something
if (var instance of Z)
.... do something
if (var instance of J)
.... do something
With Java Generics can i find out the dynamic type of var and typecast
it to its dynamic type, this will save me these unnecessary lines of
code ?
Thanks
Student
a primitive question
I receive an object var which is of the type Object
then to verify its type i write following code
if (var instance of X)
.... do something
if (var instance of Y)
.... do something
if (var instance of Z)
.... do something
if (var instance of J)
.... do something
With Java Generics can i find out the dynamic type of var and typecast
it to its dynamic type, this will save me these unnecessary lines of
code ?
Thanks
Student