-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCollection.cs
More file actions
43 lines (40 loc) · 803 Bytes
/
Collection.cs
File metadata and controls
43 lines (40 loc) · 803 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
using System;
using System.Collections.Generic;
using System.Threading;
namespace ConsoleApp76
{
/* class GenericTest<T>
{
public GenericTest(T msg)
{
Console.WriteLine(msg);
}
}
class Program
{
public static void Main(string[] args)
{
var gen = new GenericTest<string>("This is Harshal raverkar");
var gen1 = new GenericTest<int>(101);
var gen2 = new GenericTest<char>('c');
}
}*/
class GenericClass
{
public void Show<T>(T msg)
{
Console.WriteLine(msg);
}
}
class Program
{
public static void Main(string[] args)
{
GenericClass genc = new GenericClass();
genc.Show("Hello Harshal ");
genc.Show(101);
genc.Show(1.2345);
genc.Show('d');
}
}
}