What does (angle brackets) mean in Java?

后端 未结 6 1534
轮回少年
轮回少年 2020-11-22 05:12

I am currently studying Java and have recently been stumped by angle brackets(<>). What exactly do they mean?

public class Pool{
    public inter         


        
6条回答
  •  囚心锁ツ
    2020-11-22 06:11

    <> is used to indicate generics in Java.

    T is a type parameter in this example. And no: instantiating is one of the few things that you can't do with T.

    Apart from the tutorial linked above Angelika Langers Generics FAQ is a great resource on the topic.

提交回复
热议问题