1. package com.lan.generic;  
  2.   
  3. import com.sun.accessibility.internal.resources.accessibility;  
  4.   
  5. //自定义类上的泛型  
  6. public class Demo1<T> {  
  7.       
  8.     public void testfuntion() {  
  9.         funtion("aaa");  
  10.     }  
  11.     //自定义带泛型的方法  
  12.     public <T>T funtion(T t) {  
  13.           
  14.         return null;  
  15.     }  
  16.       
  17.     public <T,E,K>void b(T t,E e,K k) {  
  18.           
  19.     }  
  20.   
  21.     //静态方法泛型定义在static后   
  22.     public static<T> void c(T t) {  
  23.           
  24.     }  
  25. }  
  26.