C# Abstract (Soyutlama )

6. May 2009

Read this article in your language IT | EN | DE | ES

Merhaba Arkadaşlar  bu  makkalede sizlere c# Abstract Soyut Sınıflardan  anlatım  yapacağım öncelikle   abstract   sınıfı  tanıyalım soyut sınıfın oluşumu 

 

using System;

/// <summary>

/// Author Orhan Türk

/// WebSite : http://orhanturk.com.tr

/// Proje  Description Soyutlama (Abstraction)

/// </summary>

 

abstract public class MotorVehicle

{

 

    //  property tanımlıyoruz

 

    public string make;

    public string model;

 

    public MotorVehicle(string _make, string _model)

    {

        this.make = _make;

        this.model = _model;

    }

    abstract public void Accelerate();

 

}

 

/// <summary>

///   oluşturmuş oldugumuz class  MotorVehicle class   oluşturmuş oldumuz  class cagıryoruz

/// </summary>

public class Product : MotorVehicle

{

    public Product(string make, string model) :

        //burada base tip  üretiyoruz

        base(make, model)

    {

        // do nothing

    }

    /// <summary>

    /// Burada metod override ediyoruz

    /// </summary>

    public override void Accelerate()

    {

        Console.WriteLine("In Product Accelerate() method");

        Console.WriteLine(model + " accelerating");

    }

}

 

 

class MainClass

{

    /// <summary>

    /// Burada  Product tip  instance  oluşturuyoruz 

    ///

    /// </summary>

    public static void Main()

    {

        Product myProduct = new Product("Toyota", "MR2");

        myProduct.Accelerate();

        Console.ReadLine();

    }

}

Projenin Full   Source Code Ekliyorum  Abstact.rar (20,18 kb)

Evet  Arkadaşlar  Bir makkenin sonuna daha gelmiş  olduk Başka bir makkalede görüşmek üzere

Saygılarımla Orhan Türk 


FacebookDigg It!DZone It!StumbleUponTechnoratiRedditDel.icio.usNewsVineFurlBlinkList

C# ,

Comments

8/14/2009 9:06:26 PM #
I am quite interesting in this topic hope you will elaborate more on it in future posts.
8/14/2009 9:06:46 PM #
Very interesting topic will bookmark your site to check if you write more about in the future.
8/16/2009 7:25:49 PM #
Would you like to post a guest post on my blog?
8/16/2009 7:26:13 PM #
Do you accept guest posts? I would love to write couple articles here.
8/27/2009 6:04:01 AM #
Please let me know if you are interested to work as article writer for me? I can offer $10/article.
8/27/2009 6:04:21 AM #
I would like to add your blog to my blogroll please tell me what anchor should I use?
3/16/2010 3:28:21 PM #
I really like following these updates. It  completely makes the morning.
5/7/2010 5:27:32 AM #
c# abstract c# abstract c# abstract Hello, U mark some enormously attractive blogs. I always check back here time and again to determine if you have updated
5/9/2010 9:24:29 AM #
I love your blog
5/20/2010 6:16:29 AM #
If you liked this post you'll almost certainly like this site too: http://www.winfreegiftcardsonline.com .  It is a nice website for winning gift vouchers online .

Add comment


(Will show your Gravatar icon)

biuquote
  • Comment
  • Preview
Loading



Sayfa 0.031172 saniyede yuklendi.