Generics In Java

Examples uses of Generics in Java are:-

Finally let’s take a look at all of the Advantages that Generics provides:-

  1. Code Reusability — Write once use for any number of data types.
  2. Type Safety — With the help of Generics we can see the errors appear at Compile time rather than having to face them at Run-Time.
  3. Individual Type Casting Is Not Needed — If we already know that our list only holds string data then we need not to typecast it every time.
  4. Generic Algorithms — With the help of Generics we can implement algorithms that work on the different type of objects and are type-safe too.

References

--

--

--

Software Developer ,currently pursuing B.Tech in Information Technology. Electronic Dance Music is love.Also like all phone related technologies

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Which agile certification to be taken and at what point of time?

Write Files From EC2 To S3 In AWS, Programmatically

The Ultimate Guide to AWS DynamoDB

My Experience With Interview Kickstart

Virtual Private Cloud

How To Use Python To Buy Options From Robinhood

Introducing KoinKnight Widget

The Three-Step Recipe to Success with Legacy Code without Getting Overwhelmed

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Anubhav Mishra

Anubhav Mishra

Software Developer ,currently pursuing B.Tech in Information Technology. Electronic Dance Music is love.Also like all phone related technologies

More from Medium

Java for SDET/QA’s

Java Encapsulation

Java Fundamentals

Programming in Java