public class Test<T> { private T a; public Test(T a) { this.a = a; } public T getA() { return a; } public void setA(T a) { this.a = a; } public static void main(String[] args) { Test<String> test = new Test<>("test"); System.out.println(test.getA()); } }
时间: 2024-12-16 15:47:11