Tag Archives: Generics

Generics with class and method

Generics is an interface or class that can be used with many different types. Following note will describe generics using in class and method in general. Generic class Defined with format: class Box <T1, T2, …,Tn> { /*…*/} Used:  Box<String, Integer, MyClass, MyInterface> box = new Box<String, Integer, MyClass, MyInterface>(“Hello”,1, car, toy) Noticeable that T type should be… Read More »