google.com, pub-5796814184912345, DIRECT, f08c47fec0942fa0 Program with System Defined Default Constructor code example in oops in C# dot net
02 05 08

Program with System Defined Default Constructor code example in oops in C# dot net


Program with System Defined Default Constructor code example in oops in C# dot net  : in this Program we will give the example program of System Defined Default Constructor . so please follow below code and run in your dot net software

Program with System Defined Default Constructor:

Diagram:

employee2
Int EmpId
String EName
String EAddress
Int EAge
Public void DisplayEmpData()



using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CAConstructors
{
    class employee2
    {
        int Empid, Eage;
        string Ename, Eaddress;
        public void DisplayEmpdata()
        {
            Console.WriteLine("Employee id is :-" + Empid);
            Console.WriteLine("Employee Name is :-" + Ename);
            Console.WriteLine("Employee Adderse is :-" + Eaddress);
            Console.WriteLine("Employee age is :-" + Eage);
        }
    }
    class SDConsttructor
    {
        static void Main(string[] args)
        {
            employee2 obj1 = new employee2();
            employee2 obj2 = new employee2();
            obj1.DisplayEmpdata();
            obj2.DisplayEmpdata();
            Console.ReadLine();
        }
    }
}
Output:




Both default constructors have a drawback that for number of  objects created to the class all objects will store for same data in their referenced data fields.
To over come this draw back we use parameterized constructor.

Latest Walkins 2013(updated every day )



Hyderabd Walkins 2013

walkins in chennai2013-14

walkins in Chandigarh2013

Walkins In Mumbai 2013

pune In Walkins 2013

Kolkata in walkins 2013

Ahmedabad JOBS 2013

Banglore walkins

Dotnet jobs

09 10

0 comments:

  © Blogger templates Newspaper III by Ourblogtemplates.com 2008

Back to TOP