Tutorial by Topics: cs

Generics are a facility of generic programming that extend Java's type system to allow a type or method to operate on objects of various types while providing compile-time type safety. In particular, the Java collections framework supports generics to specify the type of objects stored in a collection instance.

Topics organize Examples into an easily digestible page. They should be self-contained and written for the benefit of the reader in a hurry.

A List can hold numbers, words or really anything. That's why we call the List generic.

Generics are basically used to define which types a class can hold and which type an object currently holds.

A set is a collection of items which can be anything. Whatever operator we need to work on these sets are in short the set operators and the operation is also known as set operation. Basic set operation includes Union, Intersection as well as addition, subtraction, etc.

Page 1 of 8