About exercise of Delegate
来源:互联网 发布:安卓6.0的数据库在哪 编辑:程序博客网 时间:2024/06/11 16:21
Q:Create a delegate and use it to impersonate the Console.Readline() fuction when asking for user input.
A:class Program
{
delegate string ReadLineDelegate();
static void Main(string[] args)
{
ReadLineDelegate readLine = new ReadLineDelegate(Console.ReadLine);
Console.WriteLine("Type a string");
string userInput = readLine();
Console.WriteLine("You typed:{0}",userInput);
Console.ReadKey();
}
}
- About exercise of Delegate
- About Delegate and Event
- Exercise of Thread(1)
- Exercise of Thread(2)
- Exercise of Thread(3)
- About Delegate and Anonymous methods
- 线程——thread exercise about file
- NOJ [1317] Exercise of Sort
- Usage of Func delegate
- About exception of Java
- About Thinking of Designing
- About memory of imageNamed
- About TreeView of C#
- about Query of hibernate
- about bag of word
- about hashtags of tweet
- About of jcl
- Solution for Exercise 15.1-2 of CLRS
- Recordset.Open参数说明(转)
- 图解MyEclipse配置struts+hibernate+spring+FreeMarker
- Beginning
- 项目文件自动备份及删除
- 一个HR人给应届生的面试建议
- About exercise of Delegate
- Delphi-Timer定时器使用
- 日历控件
- VC++开发BHO插件
- javascript 使用面向对象的技术创建高级 Web 应用程序
- joomla案例展示
- 计算机技术
- Oracle Concept 的一些笔记 -- PGA
- 如何执行存储过程以及如何进行调试?