-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprog4.java
53 lines (51 loc) · 1.72 KB
/
prog4.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
interface resume{
void biodata();
}
class Teacher implements resume{
private String personalInfo;
private String qualification;
private String experience;
private String achievements;
public Teacher(String personalInfo, String qualification, String experience, String achievements){
this.personalInfo = personalInfo;
this.qualification = qualification;
this.experience = experience;
this.achievements = achievements;
}
public void biodata(){
System.out.println("Teacher Biodata:");
System.out.println("Personal Information: " + personalInfo);
System.out.println("Qualification: " + qualification);
System.out.println("Experience: " + experience);
System.out.println("Achievements: " + achievements);
System.out.println("-------------------------");
}
}
class Student implements resume {
private String personalInfo;
private String result;
private String discipline;
// Constructor
public Student(String personalInfo, String result, String discipline) {
this.personalInfo = personalInfo;
this.result = result;
this.discipline = discipline;
}
// Implementing the biodata method from the Resume interface
@Override
public void biodata() {
System.out.println("Student Biodata:");
System.out.println("Personal Information: " + personalInfo);
System.out.println("Result: " + result);
System.out.println("Discipline: " + discipline);
System.out.println("-------------------------");
}
}
public class prog4 {
public static void main(String[] args) {
Teacher teacher=new Teacher("A","A","A","A");
Student student=new Student("A","A","A");
teacher.biodata();
student.biodata();
}
}