public void printMyGender(String s){

this.print();

System.out.print(s+" ");

}

}

class Gender{

String type="gender";

public void print(Person p){p.printMyGender(type);}

}

class Female extends Gender{

public Female(){

type="female";

}

}

class Male extends Gender{

public Male(){

type="male";

}

}

class Employee extends Person{

public void print(){

System.out.print("Employee ");}

}

class Manager extends Employee{

public void print(){

System.out.print("Manager ");}

}

public class Test{

public static - 快搜搜题库"/>

public void printMyGender(String s){

this.print();

"/>

请在 下方输入 要搜索的题目:

import java.io.*;</p></p><p><p>class Person{</p></p><p><p>public void print(){System.out.print("Person ");}</p></p><p><p>public void printMyGender(String s){</p></p><p><p> this.print();</p></p><p><p> System.out.print(s+" ");</p></p><p><p>}</p></p><p><p>}</p></p><p><p>class Gender{</p></p><p><p> String type="gender";</p></p><p><p> public void print(Person p){p.printMyGender(type);}</p></p><p><p>}</p></p><p><p>class Female extends Gender{</p></p><p><p> public Female(){</p></p><p><p> type="female";</p></p><p><p> }</p></p><p><p>}</p></p><p><p>class Male extends Gender{</p></p><p><p> public Male(){</p></p><p><p> type="male";</p></p><p><p> }</p></p><p><p>}</p></p><p><p> class Employee extends Person{</p></p><p><p> public void print(){</p></p><p><p> System.out.print("Employee ");}</p></p><p><p>}</p></p><p><p>class Manager extends Employee{</p></p><p><p> public void print(){</p></p><p><p> System.out.print("Manager ");}</p></p><p><p>}</p></p><p><p>public class Test{</p></p><p><p> public static

import java.io.*;

class Person{

public void print(){System.out.print("Person ");}

public void printMyGender(String s){

this.print();

System.out.print(s+" ");

}

}

class Gender{

String type="gender";

public void print(Person p){p.printMyGender(type);}

}

class Female extends Gender{

public Female(){

type="female";

}

}

class Male extends Gender{

public Male(){

type="male";

}

}

class Employee extends Person{

public void print(){

System.out.print("Employee ");}

}

class Manager extends Employee{

public void print(){

System.out.print("Manager ");}

}

public class Test{

public static

发布时间:2025-08-20 12:23:56
推荐参考答案 ( 由 快搜搜题库 官方老师解答 )
联系客服
答案:Manager male Employee female
专业技术学习
专业技术学习
搜搜题库系统