このクラスで見てみましょう:
public class Cluster
{
private List<Point> points; //private field
public float ComputeDistanceToOtherClusterCLINK(Cluster cluster)
{
var max = 0f;
foreach (var point in cluster.points) // here points field are accessible
{
.......
}
return max;
}
}
なぜプライベートフィールドにアクセスできるのですか?
この機能を使用できますか、それとも悪い習慣ですか?