سلام 😉 در این مطلب از وب سایت پروگرم 98 کد Generic Interface در سی شارپ #C را آماده کردم. انشاالله که این کد براتون مفید باشه.
خروجی این کد به این صورت است:
5
Hi there.
Hi there.
کد Generic Interface در سی شارپ #C :
using System;
using System.Collections.Generic;
interface GenericInterface<T>
{
T getValue(T tValue);
}
class MyClass<T> : GenericInterface<T>
{
public T getValue(T tValue)
{
return tValue;
}
using System.Collections.Generic;
interface GenericInterface<T>
{
T getValue(T tValue);
}
class MyClass<T> : GenericInterface<T>
{
public T getValue(T tValue)
{
return tValue;
}