私有成员
using System;public interface ishape
{
double area();
double gramlength();
int sides{get;}
void play();
}
public interface ishapeplay
{
void play();
}
public class square:ishape,ishapeplay
{
private int sides;
public int sidelength;
public square()
{
get {return sides;}
}
public double area()
{
return ((double)(sidelength*sidelength));
}
public double gramlength()
{
return ((double)(sides*sidelength));
}
void ishape.play() //注意:这个显式实现是个私有成员,不能用public 修饰
{
Console.WriteLine("\n计算机面积结果如下:");
}
}
俺在书上看到此例。。请问。。这里的ishape.play为什么是不能用public修饰,而area()方法则可以用public修饰呢????