Tag: generics

991 Create Generic method constraining T to an Enum 2008-09-17T01:56:19.267

961 How to Sort a List<T> by a property in the object 2010-07-22T13:13:25.497

929 How to create a generic array in Java? 2009-02-09T17:30:44.417

887 How do I use reflection to call a generic method? 2008-10-24T05:17:35.217

649 Is List<Dog> a subclass of List<Animal>? Why are Java generics not implicitly polymorphic? 2010-04-30T14:39:39.237

624 Difference between <? super T> and <? extends T> in Java 2010-12-03T06:57:06.297

586 What is PECS (Producer Extends Consumer Super)? 2010-04-27T17:16:40.273

577 How to get the type of T from a member of a generic class or method? 2009-02-17T15:24:36.940

551 How to get a class instance of generics type T 2010-08-09T06:58:45.707

549 What is a raw type and why shouldn't we use it? 2010-05-05T02:48:53.157

530 How do I address unchecked cast warnings? 2009-02-03T21:57:47.563

510 Create instance of generic type in Java? 2008-09-16T18:04:28.603

486 How do I clone a generic list in C#? 2008-10-21T16:47:05.823

486 How do I make the method return type generic? 2009-01-16T15:43:08.693

466 How can I return NULL from a generic method in C#? 2008-11-19T14:51:41.877

458 Why does C# forbid generic attribute types? 2008-11-16T18:48:02.777

448 List<T> or IList<T> 2008-12-30T12:18:09.357

417 Remove duplicates from a List<T> in C# 2008-09-06T19:15:27.690

413 What is the point of the diamond operator in Java 7? 2010-11-12T16:43:23.820

412 List<T> OrderBy Alphabetical Order 2008-10-09T16:48:03.313

401 Get generic type of class at runtime 2010-08-04T08:44:44.990

381 What is SuppressWarnings ("unchecked") in Java? 2009-07-15T06:50:58.680

374 What are the reasons why Map.get(Object key) is not (fully) generic 2009-05-13T11:28:30.927

366 Passing arguments to C# generic new() of templated type 2009-05-08T15:04:29.653

359 A generic list of anonymous class 2009-03-04T22:08:47.033

359 How to remove elements from a generic list while iterating over it? 2009-10-17T14:12:35.363

358 Potential heap pollution via varargs parameter 2012-09-17T15:04:12.357

355 Google Gson - deserialize list<class> object? (generic type) 2011-04-05T15:17:33.000

333 Java Generics Wildcarding With Multiple Classes 2009-04-13T23:21:54.200

332 ArrayList vs List<> in C# 2010-02-22T08:36:55.467

321 Passing a single item as IEnumerable<T> 2009-10-16T12:40:17.323

314 Is there a constraint that restricts my generic method to numeric types? 2008-08-28T16:04:49.797

307 Method has the same erasure as another method in type 2010-01-04T09:58:49.820

294 C# generics syntax for multiple type parameter constraints 2009-06-08T15:45:55.897

287 Can't operator == be applied to generic types in C#? 2008-12-24T06:32:28.187

278 IEnumerable and Recursion using yield return 2010-01-13T10:26:20.997

272 Check if a class is derived from a generic class 2009-01-19T14:10:18.140

265 Java generics - why is "extends T" allowed but not "implements T"? 2009-06-10T15:42:33.507

242 Collections.emptyList() returns a List<Object>? 2008-11-20T20:17:33.483

238 Nullable type as a generic parameter possible? 2008-10-16T15:53:42.847

231 What does "where T : class, new()" mean? 2011-01-19T16:37:42.240

228 What's the difference between SortedList and SortedDictionary? 2009-06-01T16:35:45.853

228 What is a higher kinded type in Scala? 2011-06-05T23:50:56.133

227 What causes javac to issue the "uses unchecked or unsafe operations" warning 2008-10-13T15:27:28.920

226 Null or default comparison of generic argument in C# 2008-09-15T18:17:59.190

226 What's the reason I can't create generic array types in Java? 2010-05-28T07:47:50.957

222 Get generic type of java.util.List 2009-12-21T21:08:43.273

222 ReSharper warns: "Static field in generic type" 2012-03-10T15:33:09.570

221 Scala: Abstract types vs generics 2009-07-20T16:30:58.653

220 Using Mockito to mock classes with generic parameters 2009-10-30T22:48:52.583

216 Generic method with multiple constraints 2009-02-26T00:55:07.580

213 Java generics type erasure: when and what happens? 2008-12-04T06:13:02.247

212 Convert generic List/Enumerable to DataTable? 2009-02-19T08:10:18.840

204 What are the differences between Generics in C# and Java... and Templates in C++? 2008-08-28T05:08:06.663

203 Generic type conversion FROM string 2008-08-12T09:13:23.520

202 How do you cast a List of supertypes to a List of subtypes? 2009-06-01T03:25:18.440

202 Why don't Java Generics support primitive types? 2010-04-27T13:24:17.633

201 What is the difference between '?', 'E', and 'T' for Java generics? 2011-05-15T11:58:12.713

200 How to use Class<T> in Java? 2009-01-20T17:38:46.253

190 How to Pass Parameters to Activator.CreateInstance<T>() 2010-03-16T00:07:07.757

182 Create instance of generic type? 2009-04-08T19:26:06.550

182 Case insensitive access for generic dictionary 2012-11-05T10:42:05.173

179 How to reference generic classes and methods in xml documentation 2009-02-10T12:50:38.833

176 Difference between List, List<?>, List<T>, List<E>, and List<Object> 2011-06-03T19:52:26.463

174 What does the question mark in Java generics' type parameter mean? 2010-06-09T20:38:22.003

173 Static method in a generic class? 2009-06-01T19:35:34.233

170 convert a list of objects from one type to another using lambda expression 2009-12-15T18:06:13.797

170 The type must be a reference type in order to use it as parameter 'T' in the generic type or method 2011-06-23T08:13:35.147

169 Generic TryParse 2010-06-02T21:16:30.737

169 Generic return type upper bound - interface vs. class - surprisingly valid code 2016-04-04T12:27:02.337

166 What is the best way to clone/deep copy a .NET generic Dictionary<string, T>? 2008-09-26T13:46:51.240

166 When do Java generics require <? extends T> instead of <T> and is there any downside of switching? 2009-05-22T13:48:39.317

157 Java: how do I get a class literal from a generic type? 2010-03-05T23:33:08.000

156 Pass An Instantiated System.Type as a Type Parameter for a Generic Class 2008-11-05T18:19:51.687

155 How do you convert a DataTable into a generic list? 2008-10-16T13:23:50.543

154 Performance of Arrays vs. Lists 2009-01-18T10:20:11.840

148 What is reification? 2015-08-07T11:13:14.837

147 Nullable type issue with ?: Conditional Operator 2008-11-17T15:18:35.740

145 C#: Printing all properties of an object 2009-05-12T10:53:04.550

145 Why can't the C# constructor infer type? 2010-08-25T21:02:23.743

144 Select a Dictionary<T1, T2> with LINQ 2009-03-06T00:20:24.323

144 Is it possible to solve the "A generic array of T is created for a varargs parameter" compiler warning? 2009-09-18T15:21:25.133

143 Why doesn't the example compile, aka how does (co-, contra-, and in-) variance work? 2009-03-19T17:46:16.257

143 Java Map equivalent in C# 2009-03-26T23:30:14.923

143 Func<T> with out parameter 2009-08-15T23:45:58.503

142 Mockito: List Matchers with generics 2012-05-09T08:22:58.197

141 <out T> vs <T> in Generics 2012-06-08T23:05:42.947

140 How do I clone a generic List in Java? 2008-09-10T18:11:50.947

140 How can I use interface as a C# generic type constraint? 2009-07-08T07:18:02.060

140 How to make a Java class that implements one interface with two generic types? 2009-08-19T05:43:46.130

137 What are the differences between "generic" types in C++ and Java? 2008-08-30T21:14:27.623

137 Are there strongly-typed collections in Objective-C? 2009-05-11T15:27:22.350

137 Instantiating a generic class in Java 2009-07-07T05:13:23.610

136 Java Enum definition 2008-10-17T05:14:15.960

136 Is there a generic constructor with parameter constraint in C#? 2009-12-05T17:37:16.933

136 How to make a Java Generic method static? 2010-12-10T13:05:46.650

134 Why aren't Java Collections remove methods generic? 2008-09-19T19:26:55.330

134 Correct way to check if a type is Nullable 2012-01-20T10:26:20.263

133 Why are arrays covariant but generics are invariant? 2013-09-06T21:16:49.463