using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication35
{
class student<T, C>
{
C name;
T grade;
public student(C name, T grade)
{
this.name = name;
this.grade= grade;
}
public override string ToString()
{
return string.Format(" name : {0} \n grade : {1} ", name,grade);
}
}
class Program
{
static void Main(string[] args)
{
student<int, string> s = new student<int, string>("budi", 1);
student<int, int> a = new student<int, int>(600, 1);
Console.WriteLine(s);
Console.WriteLine(a);
}
}
}
No comments:
Post a Comment