What are Java Generics?

preview_player
Показать описание
Have you ever seen Java code with angle brackets in a type like perhaps
ArrayLists of HashMaps? Those are called "Generics", because they are generic classes that can use any kind of class in them.

In this lecture, designed for second year programming students at Westmont College, Prof. Patterson introduces the motivations and syntax for Java Generics. He shows how to both *use* a class that leverages Generics as well as how to *create* classes that leverage Generics themselves. When you are done you will have a better understanding of how to maximize your code reuse and improve your code architecture.

Get that code crackin'!
Рекомендации по теме
Комментарии
Автор

It is great! I subscribed for your channel. But you didn't mention about generic restrictions like exceptions, inner class and static. And may be more about covariance, invariance, and contravariance.

nazarovoleksandr
Автор

Why all this ”beating around the bush”? Too much talk about irrelevant stuff. And, hey, List is not a super class, it is actually called an interface, ok!

oskarbergstrom