Listout of, since it's just a whole bunch of objects put together.
<>and can be appended to methods and classes. Here's an example with classes:
SomeTypeis a Generic Type Variable that is not a real type, but can still be used inside the class as normal.
Stringis an Actual Type Argument that replaces
SomeTypeduring runtime. Now, every time
SomeTypeis used in
SomeClassJava treats it exactly like a
List<int>is invalid and will not work!
Characterand so on. However, converting between these types and primitive types, which is called autoboxing, has significant performance penalties that must be taken into consideration.
new List<X>() instanceof List<Y>will always be true regardless of what types X and Y are.