Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1
Class templates are a kind of template. The symbols to fill them in are data types. Class templates are supported by many programming languages including Java, c++, c#. In Java, an example is its java.util.LinkedList. You could make a list specifically of integers described in Java by java.util.LinkedList<Integer>. In those languages, class templates have the benefit of more precisely defining data type for variables and parameters. They also allow the compiler to do more optimization without programmers having to write more code.
4th Nov 2020, 12:48 AM
Josh Greig
Josh Greig - avatar