سلام بر تمامی برنامه نویسان عزیز 😉 در این پست کد پیاده سازی multiple generic interfaces از طریق non-generic class در سی شارپ #C را آماده کردم. انشاالله که این کد سی شارپ براتون مفید باشد.
خروجی این کد به این صورت است:
5
Hi there.
Hi there.
کد پیاده سازی multiple generic interfaces از طریق non-generic class در سی شارپ #C :
using System;
using System.Collections.Generic;
interface GenericInterface<T>
{
T getValue(T inValue);
}
class MyClass : GenericInterface<int>, GenericInterface<string>
{
public int getValue(int inValue)
{
return inValue;
}
public string getValue(string inValue)
{
return inValue;
}
using System.Collections.Generic;
interface GenericInterface<T>
{
T getValue(T inValue);
}
class MyClass : GenericInterface<int>, GenericInterface<string>
{
public int getValue(int inValue)
{
return inValue;
}
public string getValue(string inValue)
{
return inValue;
}