java继承
package depo; import java.util.Set; public class day1z extends day1 { public static void main(String[] args) { day1 day1 = new day1(); day1.setName("张三"); day1.setAge(14); day1.setSex("男"); System.out.println(day1.getName()); System.out.println(day1.getAge()); System.out.println(day1.getSex()); day1.wan(); } } package depo; public class day1 { private String name; private int age; private String sex; public day1(String name, int age, String sex) { super(); this.name = name; this.age = age; this.sex = sex; } public day1() { super(); } public String getName() { return name; } public void setName(String name) { this.name = name; } public int getAge() { return age; } public void setAge(int age) { this.age = age; } public String getSex() { return sex; } public void setSex(String sex) { this.sex = sex; } public void wan(){ System.out.println("法外狂徒张三"); } }