public class Persons
{
private String name;
public Persons()
{
name = "No name yet";
}
public Persons(String initialName)
{
name = initialName;
}
public void setName(String newName)
{
name = newName;
}
public String getName()
{
return name;
}
public void writeOutput()
{
System.out.println("Name: " + name);
}
public boolean hasSameName(Persons otherPerson)
{
return this.name.equalsIgnoreCase(otherPerson.name);
}
}
Given the class Person above, write the following classes
1-
Class Practitioner.java
Class that extends Person to include
specialty
office fee
plus various constructors
set methods to change all parameters
at once or each individually
write methods to display all parameters or each individually,
an equals method to test if:
o
all parameters for two doctors are equal.
WriteOutput method
2-
Class Patient. Java
Class that extends Person to include
Social security
Gender
Appropriate constructors, accessors, and mutators.
WriteOutput method
3-
Class dependent.java
Class that extends Patient to include
Age
Appropriate constructors, accessors, and mutators.
WriteOutput method
4-
A class to Test dependent.java
5-
PolymorphismDemo.java
Given the cas Person above, write the following classes dass 3 Class Praction Java Class that extends Person to indute . offee Jucarious construction et method to change al punten • reaching whethods to appears archiv and olare for two doctor • WreOutput method Clusteri Catatan Pentinue • Gender Appropue синінами, внимание на ин • Watt en dependent as that tendinte de Artist, • Wie - Antilleries Puer. uchun puterna lice 1 poingia wamewe
public class Persons { private String name; public Persons() { name = "No name yet"; } public Persons(String initialName
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
public class Persons { private String name; public Persons() { name = "No name yet"; } public Persons(String initialName
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!