0% found this document useful (0 votes)
7 views2 pages

Java Patient Details Program

The document contains a Java program that defines an abstract class BB and a subclass BB1 that implements a method to collect and display patient details such as name, age, blood group, phone number, and weight. The main class AC creates an instance of BB1, invokes the display method to gather patient information, and then calls the print method to output the collected details. The program utilizes the Scanner class for user input and demonstrates basic object-oriented programming concepts.

Uploaded by

ajaysir2k6
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views2 pages

Java Patient Details Program

The document contains a Java program that defines an abstract class BB and a subclass BB1 that implements a method to collect and display patient details such as name, age, blood group, phone number, and weight. The main class AC creates an instance of BB1, invokes the display method to gather patient information, and then calls the print method to output the collected details. The program utilizes the Scanner class for user input and demonstrates basic object-oriented programming concepts.

Uploaded by

ajaysir2k6
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

import [Link].

*;

abstract class BB{

abstract void display();

class BB1 extends BB{

String name;

int age;

String bg;

String pn;

int w;

void display(){

Scanner s=new Scanner([Link]);

[Link]("Enter the Patient Name:");

name=[Link]();

[Link]("Enter the Patient Age:");

age=[Link]();

[Link]();

[Link]("Enter the Patient bloodgroup:");

bg=[Link]();

[Link]("Enter the Patient Phonenumber: ");

pn=[Link]();

[Link]("Enter the Patient Weight:");

w=[Link]();

void print(){

[Link]("---------------------Patient Details---------------");

[Link]("Patient name:"+name);

[Link]("Patient age:"+age);

[Link]("Patient Bloodgroup:"+bg);

[Link]("Patient phonenumber:"+pn);

[Link]("Patient Weight:"+w);

ARUNMANIKANDAN.K
24CSEA39
}

public class AC {

public static void main(String[] args) {

BB1 b1=new BB1();

[Link]();

[Link]();

ARUNMANIKANDAN.K
24CSEA39

You might also like