Toip 10 Advantages Of Delegates
- Using delegates with a single call we can invoke multiple methods.
- Implementation of delegates will improve the performance of the application
- Multiple class Files
- Byvdefault every project will come with single class file but it can contain multiple class files
Example for multiple class files
Step1:open a console application and rename it as multiple class files example
Step2:
Add one more class file to the solution explorer i.e class1.cs
namespace MultipleClassFilesExample
{
class Employee
{
internal void Induction()
{
console.writeLine("every employee has to attend induction training");
}
interna void Appraisal()
{
console.writeline("every employee will have apprisal for an year");
}
internal void Nop(0
{
Console.writeline("every employee has to serve notice period while leaving company");
}
}
}
Step4:
wrote below code program.cs
namespace MultipleFilesExample
{
class program
{
void main()
{
Employee obj=new employee();
obj.Induction();
obj.Appraisal();
obj.Nop();
console.Readline();
}
}
}
Friends You like My Post please Share To your Friends Through Facebook,,Twitter,Google+.You Feel Free Comment On my post Thank you.
0 comments:
Post a Comment