please teach me how to convert the code into a interface. What should be done is that there is a person class which has a name, address, gender, and phone. then a student, faculty, staff class which inherits the person class. but the student has a course and major, faculty has a rank and research area, and staff has a position and an office
this is my person code //Person.java
class Person{
private String myName;
private String myAddress;
private char myGender;
private int myPhone;
public Person()
{
myName = "";
myAddress = "";
myGender = 'N';
myPhone = 0;
}
public Person(String name, String address, char gender, int phone){
myName = name;
myAddress = address;
myGender = gender;
myPhone = phone;
}
public String getName(){
return myName;
}
public String getAddress()
{
return myAddress;
}
public char getGender()
{
return myGender;
}
public int getPhone()
{
return myPhone;
}
public void setName(String name)
{
myName = name;
}
public void setAddress(String address)
{
myAddress = address;
}
public void setGender(char gender)
{
myGender = gender;
}
public void setPhone(int phone)
{
myPhone = phone;
}
public String toString()
{
return myName + ", address: " + myAddress + ", gender: " + myGender + ", phone: " + myPhone;
}
}
this is my student code //Student.java
class Student extends Person
{
private String myCourse;
private String myMajor;
public Student()
{
super();
myCourse = "";
myMajor = "";
}
public Student(String name, String address, char gender, int phone,
String course, String major)
{
super(name, address, gender, phone);
myCourse = course;
myMajor = major;
}
public String getCourse()
{
return myCourse;
}
public String getMajor()
{
return myMajor;
}
public void setCourse(String course)
{
myCourse = course;
}
public void setMajor(String major)
{
myMajor = major;
}
public String toString()
{
return super.toString() + ", course: " + myCourse + ", major: " + myMajor;
}
}
this is my faculty code //Faculty.java
public class Faculty extends Person
{
private String myRank;
private String myResearch;
public Faculty()
{
super();
myRank = "";
myResearch = "";
}
public Faculty(String name, String address, char gender, int phone, String rank, String research)
{
super(name, address, gender, phone);
myRank = rank;
myResearch = research;
}
public String getRank()
{
return myRank;
}
public String getResearch()
{
return myResearch;
}
public void setRank(String rank)
{
myRank = rank;
}
public void setResearch(String research)
{
myResearch = research;
}
public String toString() {
return super.toString() + ", rank: " + myRank + ", research: " + myResearch;
}
}
this is my staff code //Staff.java
public class Staff extends Person
{
private String myPosition;
private String myOffice;
public Staff()
{
super();
myPosition = "";
myOffice = "";
}
public Staff(String name, String address, char gender, int phone, String position, String office)
{
super(name, address, gender, phone);
myPosition = position;
myOffice = office;
}
public String getPosition()
{
return myPosition;
}
public String getOffice()
{
return myOffice;
}
public void setPosition(String position)
{
myPosition = position;
}
public void setResearch(String office)
{
myOffice = office;
}
public String toString() {
return super.toString() + ", position: " + myPosition + ", office: " + myOffice;
}
}
please teach me how to convert the code into a interface