Tuesday, January 25, 2022

What is object oriented programming and why we need object oriented programming?

 The object oriented programming help us to thing in real world objects. with the help of object oriented programming we are able to create more flexible and understandable any system. by using the object oriented programming we will create the relationship between two or more things. 


    using System;

    public class Program

    {

        public static void Main()

        {

            Console.WriteLine("Hello World");

        }

    }

    public class Patient

    {

        public string name { get; set; }

        public string address { get; set; }

        public Doctor doctorwhowilltreat { get; set; }

    }

    public class Doctor

    {

        public string name { get; set; }

    }

 

In the hospital management system we have class Patient and Doctor, in the patient class we have used the doctor class to build a relationship between Patient & Doctor.

 

No comments:

Post a Comment

Featured Post

What is JavaScript? What is the role of JavaScript engine?

  The JavaScript is a Programming language that is used for converting static web pages to interactive and dynamic web pages. A JavaScript e...