package com.atguigu.java2;
import java.io.Serializable;
/**
* @author Dxkstart
* @create 2021-06-07 13:37
*/
public class Creature<T> implements Serializable {//生物
private char gender;//性别
public double weight;
private void breath(){
System.out.println("生物呼吸");
}
public void eat(){
System.out.println("生物吃东西");
}
}
package com.atguigu.java2;
/**
* @author Dxkstart
* @create 2021-06-07 13:37
*/
@MyAnnotion
public class Person extends Creature<String> implements Comparable<String>,MyInterface{
private String name;
int age;
public int id;
public Person(){
}
@MyAnnotion
private Person(String name){
this.name = name;
}
@MyAnnotion
private String show(String nation){
System.out.println("我的国籍是:" + nation);
return nation;
}
public String display(String interests){
return interests;
}
@Override
public void info() {
System.out.println("我是一个人");
}
@Override
public int compareTo(String o) {
return 0;
}
}