test9.18
来源:互联网 发布:软件qa岗位职责 编辑:程序博客网 时间:2024/05/16 12:47
interface Cycle{
void description();
}
interface Unicycle extends Cycle{}
interface Bicycle extends Cycle{}
interface Tricycle extends Cycle{}
class Ufactory implements Unicycle{
public void description(){System.out.println("Unicycle factory");}
}
class Bfactory implements Bicycle{
public void description(){System.out.println("Bicycle factory");}
}
class Tfactory implements Tricycle{
public void description(){System.out.println("Tricycle factory");}
}
public class Test18 {
public static void one(Ufactory uf)
{Cycle c=uf;c.description();}
public static void two(Bfactory bf)
{Cycle c=bf;c.description();}
public static void three(Tfactory tf)
{Cycle c=tf;c.description();}
public static void main(String[] args) {
one(new Ufactory());
two(new Bfactory());
three(new Tfactory());
}
}
void description();
}
interface Unicycle extends Cycle{}
interface Bicycle extends Cycle{}
interface Tricycle extends Cycle{}
class Ufactory implements Unicycle{
public void description(){System.out.println("Unicycle factory");}
}
class Bfactory implements Bicycle{
public void description(){System.out.println("Bicycle factory");}
}
class Tfactory implements Tricycle{
public void description(){System.out.println("Tricycle factory");}
}
public class Test18 {
public static void one(Ufactory uf)
{Cycle c=uf;c.description();}
public static void two(Bfactory bf)
{Cycle c=bf;c.description();}
public static void three(Tfactory tf)
{Cycle c=tf;c.description();}
public static void main(String[] args) {
one(new Ufactory());
two(new Bfactory());
three(new Tfactory());
}
}
0 0
- test9.18
- test9
- test9
- test9.1
- test9.3
- test9.4
- test9.5
- test9.7
- test9.8
- test9.9
- test9.10
- test9.12
- test9.13
- test9.14
- test9.15
- test9.16
- test9.17
- test9.19
- Demystifying ASM REQUIRED_MIRROR_FREE_MB and USABLE_FILE_MB
- Wireless Network
- OC的内存管理
- poj 3080 Blue Jeans
- 面试经典题
- test9.18
- NYOj 976 Youth的最大化
- 整数除法
- Looper、Handler与HandlerThread
- 【学习笔记】C语言 随机数的生成原理分析和各类随机数公式
- HDFS原理及其个元素功能
- php中的几个输出函数
- poj2452
- numpy 矩阵运算的陷阱