Abstract methods and Classes
<p>A class called Patient contains 2 abstract methods namely getPatientdetails() and printPatientDetails. both methods should return nothing. A class called OutPatient is a sub class of patient but is not abstract. Patient's details include PatientName(string) and DiseaseName(String). On outpatients, we also record the DateofVisit(String) and amount charged(Float). Another class AdmittedPatient is also a sub class of patient calss and is not abstract. On admittedPatient, we also record wardName(string) and Bed Number(Int).</p>

<p>The challenge is to the Three classes and ensuring that these values are all captured from the user on runntime</p>

<pre><code>import java.io.*;

public abstract class Patient {

public abstract String getPatientDetails();

public abstract String printPatientDetails();
}



import java.io.*;
public class OutPatient extends Patient
{
String PatientName;
String DiseaseName;
String DateOfVisit;
float AmountCharged;

}


import java.io.*;
import java.util.*;
public class AdmittedPatient extends Patient
{
String PatientName;
String DiseaseName;
String WardName;
int BedNumber;
public static void main (String args []){
public abstract getPatientDetails () 
{

Scanner s=new Scanner(System.in);
OutPatient B=new OutPatient();
AmittedPatient A= new AdmittedPatient();
System.out.println("Enter Out patient Details");
System.out.println("Enter Patient's Name:");
B.PatientName=s.nextLine();
System.out.println("Enter Disease Name:");
B.DiseaseName=s.nextLine();
System.out.println("Enter Date of Visit:");
B.PatientName=s.nextLine();
System.out.println("Enter Amount Charged:");
B.PatientName=s.nextFloat();
System.out.println("Enter Admitted patient Details");
System.out.println("Enter Patient's Name:");
A.PatientName=s.nextLine();
System.out.println("Enter Disease Name:");
A.DiseaseName=s.nextLine();
System.out.println("Enter Ward Name:");
A.PatientName=s.nextLine();
System.out.println("Enter Bed Number:");
A.DiseaseName=s.nextInt();
}
public abstract printPatientDetails()
{
System.out.println("Displaying Out Patient Details")
System.out.println("Patient Name:"  +  B.PatientName);
System.out.println("Patient Disease:" +  B.DiseaseName);
System.out.println("Date of Visit:"  +  B.DateofVisit);
System.out.println("Amount Charged:"  +  B.AmountCharged);
System.out.println("Displaying Admitted Patient Details")
System.out.println("Patient Name:"  +  A.PatientName);
System.out.println("Patient Disease:"  +  A.DiseaseName);
System.out.println("Ward Name:"  +  A.PatientName);
System.out.println("Bed Number:"  +  A.DiseaseName);
}
}
}
</code></pre>

<p>The 1st Class compiles properly with no errors however the 3rd and 2nd classes have errors in them.</p>
