This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace Theory10 | |
{ | |
/// <summary> | |
/// Class ExtensionExample defines the extension method | |
/// </summary> | |
static class ExtensionExample | |
{ | |
// Extension Method to convert the fist character to |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace Theory10 | |
{ | |
class House | |
{ | |
public string HouseName; | |
public int Members; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace Theory10 | |
{ | |
class Dynamic | |
{ | |
static void Main(string[] args) | |
{ | |
dynamic i = 1; | |
Console.WriteLine(i.GetType()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace Theory_9 | |
{ | |
class Salary | |
{ | |
static void Main(string[] args) | |
{ | |
double? actualValue = null; | |
double marketValue = actualValue ?? 0.0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace Theory_9 | |
{ | |
class Numbers | |
{ | |
static void Main(string[] args) | |
{ | |
System.Nullable<int> numOne = 10; | |
System.Nullable<int> numTwo = null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace Theory_9 | |
{ | |
class Employee | |
{ | |
static void Main(string[] args) | |
{ | |
int empId = 10; | |
string empName = "Patrick"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// StudentDetails.cs | |
partial class StudentDetails | |
{ | |
public void Display() | |
{ | |
Console.WriteLine("Student Roll Number: " + _rollNo); | |
Console.WriteLine("Student Name: " + _studName); | |
} | |
} | |
// StudentDetails1.cs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// MathsDemo.cs | |
partial interface IMathsDemo | |
{ | |
int Addition(int valOne, int valTwo); | |
} | |
// MathsDemo2.cs | |
partial interface IMathsDemo | |
{ | |
int Subtraction(int valOne, int valTwo); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace Theory_9 | |
{ | |
class Parameters | |
{ | |
delegate void Display(string msg, int num); | |
static void Main(string[] args) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace Theory_9 | |
{ | |
class MultipleAnonymousMethods | |
{ | |
private delegate void Display(); | |
static void Main(string[] args) | |
{ | |
Display objDisplay = delegate |