-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathlist.cs
40 lines (33 loc) · 804 Bytes
/
list.cs
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication310
{
class student
{
public int id;
public string name;
public void display()
{
Console.WriteLine("Id : "+id);
Console.WriteLine("Name : "+name);
}
}
class Program
{
static void Main(string[] args)
{
List<student> stdlist = new List<student>()
{
new student(){id= 420 , name="ali"},
new student(){id= 9211 , name="raza"}
};
foreach (var item in stdlist)
{
item.display();
}
}
}
}