Archiv für den Tag: 2010-12-25


I’m just wri­ting some Java code and for the thousand-and-first time the­re is some­thing like public void someMethod(AnyType a) {  if (a instanceof DerivateOfAnyType) {   DerivateOfAnyType d=(DerivateOfAnyType)a;   d.someMethodOfDerivate();  } } Even though the­se-days Java has Gene­rics, Anno­ta­ti­ons and that other cool stuff, you still have need for such casts, and […]

Autocasting in Java – An approach