自定义方法使用方法:
public class GeneriMethodTest { public static void main(String[] args) { ArrayList<String> list = new ArrayList<>(); list.add("aa"); list.add("bb"); list.add("cc"); Object[] array = list.toArray(); System.out.println(Arrays.toString(array)); String[] strings = list.toArray(new String[list.size()]); System.out.println(Arrays.toString(strings)); show(1); show("hh"); show(true); } private static <T> void show(T t) { System.out.println(t); } }
标签:String,show,list,System,add,泛型,方法,out From: https://www.cnblogs.com/weiduaini/p/17197666.html