-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.cs
68 lines (53 loc) · 2.07 KB
/
Program.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
using System;
using System.Collections.Generic;
namespace hello_world
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
//variables & constants
Variables myVar = new Variables();
myVar.details();
Constants myConst = new Constants();
myConst.actions(10);
myConst.actions(25);
//inheritance, polymorphsim & encapsulation
Employee adarsh = new Manager("Adarsh", true);
Employee arpit = new Worker("Arpit", 25.5);
Employee ankur = new Worker("Ankur", 50.50);
List<Employee> employees = new List<Employee>() {
adarsh, arpit, ankur
};
for(int i=0; i<employees.Count; i++) {
employees[i].TakeVacation();
Console.WriteLine(employees[i].ToString());
}
//exception handeling
ExceptionDemo someExc = new ExceptionDemo();
//collections: array, list & dictionary
Arrays grades = new Arrays();
Lists familyMembers = new Lists();
Dict myDict = new Dict();
//interfaces
DemoInterfaces myInterfaces = new DemoInterfaces();
//abstract classes
AbsDemo absClass = new AbsDemo();
//NullOperators
NullOperators nullOper = new NullOperators();
//events & delegates
// EventDemo newEvent = new EventDemo(); //uncomment to see
//LINQ
Linq linqDemo = new Linq();
//Date & time
DateAndTime dateTime = new DateAndTime();
//Extension Methods
var name = " Adarsh Patel ";
Console.WriteLine($"totalWords: {name.WorldCount()}");
//Generics
GenericClass<string> myGeneric = new GenericClass<string>("adarsh");
myGeneric.GenericMethod("patel");
}
}
}