Respuesta :

The main advantage of generics is that they make it possible to find mistakes at compilation rather than during use (like exception handling).

Explain about the generics?

An algorithm is written in terms of types that will be described later, and these types are then instantiated as necessary for particular kinds that are provided as parameters. This is known as generic programming.

For general programming, templates are employed. They aid in the creation of generic classes and functions, enabling the creation of generic codes.

Generic terms include things like "tiger stripes," "duck lays eggs," "the dodo is extinct," and "ticks carry Lyme disease." Generics are used to express generalisations, but they do not include the number of members of the kind or category that possess the attribute, unlike quantified statements.

In a nutshell, the issue of having to use loosely typed objects is resolved by generics. Take ArrayList vs. List as an illustration. You can create a collection that is highly typed with it.

To learn more about generics refer to:

https://brainly.com/question/14611465

#SPJ4