Generics & Open recursion

1. Generics

If you are a fan of reusing code then generic programming is your best friend! Generics offer the possibility for primitive data types and user-defined types to be passed as an argument for functions (geeksforgeeks, 2019)

By taking generic programming into consideration, you should be able to solve problems that require applying the same algorithm with all data types, for the reason that the main purpose of using Generics is to avoid repeating the same algorithm when the only variable is the data type.



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