Home > DeveloperSection > Forums > object oriented programming(oop's)
Mahesh Rawat
Mahesh Rawat

Total Post:11

Points:77
Posted on    February-01-2011 1:45 AM

 OOPS OOPS 
Ratings:


 1 Reply(s)
 1209  View(s)
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


Amit Singh

Total Post:103

Points:721
Posted on    February-01-2011 2:20 AM

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();

        }

    }

}



Don't want to miss updates? Please click the below button!

Follow MindStick