2012/03/06

#21. Java generics, type erasure and lazyness

I've been doing a little personal app in Java, and recently found out that generics in Java erase type information so generics would have retro-compatibility (or at least it's what I learnt from reading this post). I can’t deny that I don’t understand the idea and the drawbacks aren’t much but what’s the meaning of doing something halfway. I was just trying to get the type of a generic variable. I don’t think that this was the only option but probably was the easiest.