Is there any reason to use generics in Java?
问题 Perhaps I'm missing the point but coming from a C# background, I can't see any reason to use Java's generics... In C# I've got a method which takes a string and deserializes it into an object... public static Deserialize<T>(string source) { // Use reflection to examine T and determine // which properties I should be reading from // the string. Create an instance of T, // populate the properties and return it } which I can call as follows: x.Deserialize<AnyClass>("String representation of