There are a number of ways to do this,
a better way would be to make this Shape an abstract class with abstract method like area and leave it to the specific shape to implement the actual area formula.
But to stick to your simple example, try this:
using System;
public class Program
{
class Shape
{
readonly double PI = 3.1416;
readonly int NumberOfSides;
private double area;
public Shape(double side1, double side2)
{
NumberOfSides = 4;
area = side1 * side2;
}
public double GetArea()
{
return area;
}
}
public static void Main()
{
Shape rectangle = new Shape(10, 20);
Console.WriteLine(rectangle.GetArea());
}
}