码迷,mamicode.com
首页 > 编程语言 > 详细

java泛型类型变量能调用的方法

时间:2018-10-04 08:55:19      阅读:160      评论:0      收藏:0      [点我收藏+]

标签:his   img   private   extend   ext   变量   col   this   ring   

public class Person {

}

 

public class Student extends Person{
    private String name;

    public Student(String name) {
        this.name = name;
    }

    public Student() {
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public String toString() {
        return "Student{" +
                "name=‘" + name + ‘\‘‘ +
                ‘}‘;
    }
}

 泛型类型变量只能调用限定类或限定接口里面的方法

技术分享图片

 

java泛型类型变量能调用的方法

标签:his   img   private   extend   ext   变量   col   this   ring   

原文地址:https://www.cnblogs.com/xiu68/p/9740686.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!