* 程序头部注释开始* 程序的版权和版本声明部分
* Copyright (c) 2011, 烟台大学计算机学院学生
* All rights reserved.* 文件名称:
* 作 者: 时永杰
* 完成日期:2012 年 4月 22日
* 版 本 号:v1.1
package jiekou;
interface person
{
String name="张三";
int age=30;
String sex="boy";
String ad="山东";
String tel="053511111";
public void show();
};
interface teacher extends person
{
String title="teacher";
}
interface cader extends person
{
String post="moster";
}
class teacher_carder implements teacher,cader
{
public void show()
{
System.out.println("name: "+name+" "+" age: "+age+" "+"sex: "+sex+" "+"ad: "+ad+" "+" tel: "+tel+" title: "+title+" post: "+post);
}
}
public class dwa {
/**
* @param args
*/
public static void main(String[] args) {
teacher_carder a=new teacher_carder();
a.show();
// TODO Auto-generated method stub
}
}
结果:
name: 张三 age: 30 sex: boy ad: 山东 tel: 053511111 title: teacher post: moster