OBJECT ORIENTED PROGRAMMING(OOP'S)

Mahesh Rawat

Total Post:11

Points:77
Posted by  Mahesh Rawat
OOPS 
 1565  View(s)
Ratings:
Rate this:
hi,
i am new so i can not understand the concept of abstract, method, inheritance, construction and object. so give one example i can understand the whole concept in one program.
thanx in advance
  1. Amit Singh

    Post:103

    Points:721
    Re: object oriented programming(oop's)

    hi mahesh
    this is the simple program, in which i used all concept, so you can easily understand it
    for example

    namespace ConsoleApplication3

    {

        // Abstract class  

        public abstract class MyClass

        {

            //define abstract method

            public abstract void DoWork();

        }  

        // Inheritance (inherited the abstract class)

        class Program : MyClass

        {

             // Constructor 

            public Program()

            {

           }      

            // Method 

            public override void DoWork()

            {

                Console.WriteLine("firstprogram");

                Console.ReadLine();

            }

            //Entry point

            static void Main(string[] args)

            {

                //object

                Program object1 = newProgram();

               object1.DoWork();

            }

        }

    }


Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!