public class Student extends GeneralElement {
private String name;
private String surname;
private String age;
private String course;
private String faculty;
Student(){
super.nameMainElement = "STUDENT";
}
protected void setCourse(String value) {
this.course = value;
}
protected void setName(String value) {
this.name = value;
}
protected void setSurname(String value) {
this.surname = value;
}
protected void setAge(String value) {
this.age = value;
}
protected void setFaculty(String value) {
this.faculty = value;
}
@Override
public String toString(){
return "\nName: " + name +
"\nSurname: " + surname +
"\nAge: " + age +
"\nCourse: " + course +
"\nFaculty: " + faculty;
}
public enum ChildrenElements {
NAME,
SURNAME,
AGE,
COURSE,
FACULTY;
}
}
public interface GeneralElement {
String getMainElement();
}
public class Student implements GeneralElement {
// тут переменные
public enum ChildrenElements {
NAME,
SURNAME,
AGE,
COURSE,
FACULTY;
}
}
public class Student implements GeneralElement {
// тут переменные
public enum ChildrenElements {
LOGIN,
PASSWORD;
}
}
public void create(GeneralElement general) {
for (general.ChildrenElements enumVar : general.ChildrenElements.values()) {
System.out.println(enumVar);
}