Java

245
2994 reads

February 24, 2013

Generic-array


This example describes to create a generic array and its initialization.
Java does not allow directly to create a generic array therefore we cast our array to generic type.

126
2389 reads

February 24, 2013

Generic Bridge Method


This example describes the use of Bridge method and shows how a compiler sometimes creates a synthetic method, called a bridge method, as part of the type erasure process.

188
4063 reads

February 24, 2013

Bounded Type Parameter


This example demonstrates to implement the bounded type parameter by using string.

182
3112 reads

February 24, 2013

Generic Method Override


This example demonstrates you to override a generic method.
A subclass overrides a method getob() of its parent class by extending the super class.

271
4732 reads

February 24, 2013

Instance of Operator


As we know instanceof operator can be used to call a method based explicitly on the non-generic class of some object.

99
2260 reads

February 24, 2013

Generic- Nongeneric Class Inheritance


A generic class can also extends a non-generic class. As this is demonstrated below in example.

226
3051 reads

February 24, 2013

Generic Inheritance with own Type Parameter


This example demonstrates you to assign an object of one type to an object of another type provided that the types are compatible by extending a super class.

299
3648 reads

February 24, 2013

Generic Class Inheritance


This example describes to subtype a generic class by extending. The relationship between the type parameters of one class and the type parameters of another are determined by the extends clauses.

202
3711 reads

February 24, 2013

Raw-Type Generic


A raw type is the name of a generic class or interface without any type arguments.

345
5360 reads

February 24, 2013

Generic Interface


This example demonstrates you to implement a generic interface.