Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Generics in Java

Generics allow you to write type-safe, reusable, and flexible code in Java by enabling parametrization of types. With generics, you can write code that works with any data type while avoiding explicit type casting and potential runtime ClassCastException.

GeoLocation Example

  • GeoLocation has a Mappable interface that defines a method to get the location as a string.
  • Layer class is a generic class that is bound to Mappable type. (means the generic can be type of Mappable only)
  • We can use Layer class with any class that implements Mappable interface.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages