BARMAJA_CSHARP Telegram 149
إ₰...👨🏻‍💻CODE👩🏻‍💻...₰❥

#تعدد_الأشكال Polymorphisme

يشابه هذا المفهوم تعدد التعريف كثيرا
ويعطينا إمكانية التعامل مع الفئات المتوارثة كما لو أنها واحدة..

وهنا كود يوضح هذا المفهوم 👇🏻

class Human
{
public Human()
{
//Codes
}
public void AddFriend()
{
//Codes
}
}

class Teatcher : Human
{
// Codes
}

class Program
{
static void Work(Human O)
{
O.AddFriend();
}
static void Main(string[] args)
{
Teacher Wasam= new Teacher();
Work(Wasam);
}
}

•┈┈┈•❈••✦✾✦••❈•┈┈┈•
❥➺┊ @barmaja_Csharp
•┈┈┈•❈••✦✾✦••❈•┈┈┈•

نلاحظ أننا أرسلنا الكائن كوسيط لإجراء Work
ووفق هذا المفهوم فبإمكانك تمرير أي فئة مشتقة من الفئة الرئيسية Human كوسيط.



tgoop.com/barmaja_Csharp/149
Create:
Last Update:

إ₰...👨🏻‍💻CODE👩🏻‍💻...₰❥

#تعدد_الأشكال Polymorphisme

يشابه هذا المفهوم تعدد التعريف كثيرا
ويعطينا إمكانية التعامل مع الفئات المتوارثة كما لو أنها واحدة..

وهنا كود يوضح هذا المفهوم 👇🏻

class Human
{
public Human()
{
//Codes
}
public void AddFriend()
{
//Codes
}
}

class Teatcher : Human
{
// Codes
}

class Program
{
static void Work(Human O)
{
O.AddFriend();
}
static void Main(string[] args)
{
Teacher Wasam= new Teacher();
Work(Wasam);
}
}

•┈┈┈•❈••✦✾✦••❈•┈┈┈•
❥➺┊ @barmaja_Csharp
•┈┈┈•❈••✦✾✦••❈•┈┈┈•

نلاحظ أننا أرسلنا الكائن كوسيط لإجراء Work
ووفق هذا المفهوم فبإمكانك تمرير أي فئة مشتقة من الفئة الرئيسية Human كوسيط.

BY ❥͢ ❈↡< C# > برمجة


Share with your friend now:
tgoop.com/barmaja_Csharp/149

View MORE
Open in Telegram


Telegram News

Date: |

As the broader market downturn continues, yelling online has become the crypto trader’s latest coping mechanism after the rise of Goblintown Ethereum NFTs at the end of May and beginning of June, where holders made incoherent groaning sounds and role-played as urine-loving goblin creatures in late-night Twitter Spaces. Telegram desktop app: In the upper left corner, click the Menu icon (the one with three lines). Select “New Channel” from the drop-down menu. The public channel had more than 109,000 subscribers, Judge Hui said. Ng had the power to remove or amend the messages in the channel, but he “allowed them to exist.” With the sharp downturn in the crypto market, yelling has become a coping mechanism for many crypto traders. This screaming therapy became popular after the surge of Goblintown Ethereum NFTs at the end of May or early June. Here, holders made incoherent groaning sounds in late-night Twitter spaces. They also role-played as urine-loving Goblin creatures. Activate up to 20 bots
from us


Telegram ❥͢ ❈↡< C# > برمجة
FROM American