【泛型】接口上定义泛型
来源:互联网 发布:广东11选5数据360遗漏 编辑:程序博客网 时间:2024/06/05 12:47
//接口上定义泛型
package fx;
import java.util.*;
interface testfxjk1<E>
{
public abstract void show(E e);
public abstract void fun(String ss);
}
class testfxjk2 implements testfxjk1<Integer>//在类上的泛型确定了接口上的泛型才能确定
{
public void show(Integer e)
{
}
public void fun(String ss)
{
}
}
class testfxjk3<E> implements testfxjk1<E>
{
public void show(E e)
{
}public void fun(String ss)
{
}
}
public class TestFXInterface {
public static void main(String[] args) {
testfxjk3<String> test=new testfxjk3<String>();
test.show("hello");
}
}
package fx;
import java.util.*;
interface testfxjk1<E>
{
public abstract void show(E e);
public abstract void fun(String ss);
}
class testfxjk2 implements testfxjk1<Integer>//在类上的泛型确定了接口上的泛型才能确定
{
public void show(Integer e)
{
}
public void fun(String ss)
{
}
}
class testfxjk3<E> implements testfxjk1<E>
{
public void show(E e)
{
}public void fun(String ss)
{
}
}
public class TestFXInterface {
public static void main(String[] args) {
testfxjk3<String> test=new testfxjk3<String>();
test.show("hello");
}
}
0 0
- 【泛型】接口上定义泛型
- 当泛型定义在接口上!!!
- 泛型定义在接口上
- Java 泛型定义在接口上
- 泛类型定义在接口上
- 泛型定义在接口
- 泛型接口的实现方式一:在子类的定义上声明泛型类型
- 黑马程序员_日记51_泛型定义在接口上
- 获取在接口或者类上定义的泛型类型
- Java泛型--泛型实例--标识接口的定义
- 电脑上常见的DB接口定义
- 定义泛型接口和类
- 泛型接口定义及其实现
- 泛型接口的定义与使用
- 泛型接口的定义与使用
- 泛型DAO接口定义
- 范型接口定义
- 接口上自定义泛型
- shared_ptr
- vs中ANSI编码和UNICODE编码及二者的兼容性问题
- 【泛型】方法声明使用泛型
- IO流
- 安卓开发中自定义View之onMeasure(),onLayout(),onDraw()讲解(一)
- 【泛型】接口上定义泛型
- 【泛型】在类声明中使用泛型
- 小马哥---高仿苹果7p 主板型号A335 6735芯片系列刷机拆机图与开机识别图
- 【泛型】泛型里有个,通配符:?
- 分布式缓存的一致性Hash的Java实现
- 【泛型】泛型限定 ?(上限和下限案例)
- leetcode oj java Non-overlapping Intervals
- 树莓派WiFi重连
- SUMO文档065:Reading SUMO networks and outputs withPython (sumolib)