コード例 #1
0
        public void ImplicitConversion()
        {
            var square = new Square(7);

            Rectangle rectangle = square; //Implicit conversion from Square to Rectangle
            DrawRectangle(rectangle);
        }
コード例 #2
0
 private static void DrawSquare(Square square)
 {
     Console.WriteLine("square = {0}", square);
 }