Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.AllergyDemo;
- public class Person {
- private String name;
- private int phone;
- private String address;
- private int age;
- public Person(String name, int phone, String address, int age) {
- super();
- this.name = name;
- this.phone = phone;
- this.address = address;
- this.age = age;
- }
- public String getName() {
- return name;
- }
- public void setName(String name) {
- this.name = name;
- }
- public int getPhone() {
- return phone;
- }
- public void setPhone(int phone) {
- this.phone = phone;
- }
- public String getAddress() {
- return address;
- }
- public void setAddress(String address) {
- this.address = address;
- }
- public int getAge() {
- return age;
- }
- public void setAge(int age) {
- this.age = age;
- }
- public String toString() {
- return " Name: " + name + ", Age: " + age + ", Address: " + address + ", Phone: " +phone;
- }
- }
- package com.AllergyDemo;
- public class Allergy_2 {
- private String allname;
- private String severity;
- public Allergy_2(String allname, String severity) {
- super();
- this.allname = allname;
- this.severity = severity;
- }
- public String getAllname() {
- return allname;
- }
- public void setAllname(String allname) {
- this.allname = allname;
- }
- public String getSeverity() {
- return severity;
- }
- public void setSeverity(String severity) {
- this.severity = severity;
- }
- public String toString() {
- return " Name: " + allname + ", Severity: " + severity;
- }
- }
- package com.AllergyDemo;
- import java.util.List;
- public class Patient{
- private List<Person> Patient;
- private List<Allergy_2> allergies;
- public List<Person> getPatient() {
- return Patient;
- }
- public void setPatient(List<Person> patient) {
- Patient = patient;
- }
- public List<Allergy_2> getAllergies() {
- return allergies;
- }
- public void setAllergies(List<Allergy_2> allergies) {
- this.allergies = allergies;
- }
- public Patient(List<Person> patient, List<Allergy_2> allergies) {
- super();
- Patient = patient;
- this.allergies = allergies;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement