class A<T> {
    private T value;

    public A(T value) {
        this.value = value;
    }

    public T getValue() {
        return value;
    }

    public void setValue(T value) {
        this.value = value;
    }

}

public class GenericDemo01 {
    public static void main(String args[]){
        A<String>a = new A<String>("呵呵");
        System.out.println(a.getValue());
    }
}

 

相关文章:

  • 2021-12-25
  • 2021-12-03
  • 2022-12-23
  • 2021-11-05
  • 2021-06-17
  • 2019-05-29
  • 2022-12-23
  • 2022-01-04
猜你喜欢
  • 2022-12-23
  • 2021-05-30
  • 2022-12-23
  • 2021-09-15
  • 2021-08-08
  • 2021-10-05
  • 2022-12-23
相关资源
相似解决方案