您当前的位置: 首页 >  段智华 Java

java 泛型学习

段智华 发布时间:2016-02-13 16:00:19 ,浏览量:8

1、学习泛型类、泛型方法、泛型参数

2、泛型的上限、下限

 

package IMF;

public class JavaGenerics {

 public static void main(String[] args) {
 //Empty empty =null;
 //empty = new Empty("spark");
 
 //System.out.println("Content:    "+ empty.getItem());
 
  //Empty empty =null;
  //empty = new Empty("Spark",6);
  //empty = new Empty ("Spark",99.9999);
  
  //System.out.println(empty.getKey() + "->" + empty.getValue());
 
  //log(empty);
  /*
  News news=null;
  news=new ITNews("Life is short,you need spak!");
     System.out.println(news.getContent());
     */
  Integer[] data ={1,2,3,4,5,6,7,8,9};
  arrayGenerics(data);
  
 }

 priva

关注
打赏
查看更多评论

段智华

暂无认证

  • 8浏览

    0关注

    1232博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文
立即登录/注册

微信扫码登录