: 是干什么用的符号
class Buffer
{
private const int defaultBufferSize = 100;
public Buffer(int bufferSize)
{
buf = new int[bufferSize];
}
public Buffer():this(defaultBufferSize)
{
}
private int[] buf;
}
我知道有继承,实现接口,泛型约束,不过这里面的:是干吗的??
public Buffer():this(defaultBufferSize)
------解决方案--------------------public Buffer():this(defaultBufferSize)
========================================
相当于默认构造函数调用带参数的构造函数