可能重复:
属性声明中的"new"关键字
请原谅我,如果这是C#101,但我想了解下面的代码:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
namespace Generics
{
class RabbitCollection : ArrayList
{
public int Add(Rabbit newRabbit)
{
return base.Add(newRabbit);
}
//collections indexer
public new Rabbit this[int index]
{
get { return base[index] as Rabbit; }
set { base[index] = value; }
}
}
}
Run Code Online (Sandbox Code Playgroud)
为什么索引器new在它面前?顺便说一下,Rabbit是另一个文件中定义的类.谢谢!
在SQL中需要有关Min Function的帮助
我有一张桌子如下图所示.
+------------+-------+-------+ | Date_ | Name | Score | +------------+-------+-------+ | 2012/07/05 | Jack | 1 | | 2012/07/05 | Jones | 1 | | 2012/07/06 | Jill | 2 | | 2012/07/06 | James | 3 | | 2012/07/07 | Hugo | 1 | | 2012/07/07 | Jack | 1 | | 2012/07/07 | Jim | 2 | +------------+-------+-------+
我想得到如下的输出
+------------+------+-------+ | Date_ | Name | Score | +------------+------+-------+ | 2012/07/05 | Jack | 1 | | …
任何人都可以指导我在线文档或书籍,我可以在其中找到并了解C语言中的Python实现,例如Perl的 这个:http://perldoc.perl.org/index-internals.html或本书:扩展和Simon Cozen嵌入Perl.