Java汎用---汎用の継承
1019 ワード
Javaにおける汎用継承の使用方法とルール
/**
* , >=
* 1. --->
* 2. --->
*
*
* 1.
* 2.
* 3.
* 4.
* @author Administrator
*
*/
public abstract class GenericExtends {
T1 age;
public abstract void test(T2 name);
}
// ( )--->
//1.
class F1 extends GenericExtends{
@Override
public void test(T2 name) {
// TODO Auto-generated method stub
}}
//2.
class F2 extends GenericExtends{
@Override
public void test(T2 name) {
// TODO Auto-generated method stub
}}
// --->
//1.
class F3 extends GenericExtends{
@Override
public void test(String name) {
// TODO Auto-generated method stub
}}
//2. ( , Object)
class F4 extends GenericExtends{
@Override
public void test(Object name) {
// TODO Auto-generated method stub
}}