using System;
public class Program
{
public static void Main()
Rectangle r = new Rectangle();
r.Acceptdetails();
r.Display();
}
public class Rectangle
//private member variables
private double _length;
private double _width;
// method is accessible to the public
public void Acceptdetails()
_length = 55;
_width = 66;
// method is hidden, and can only be used in the class context
private double GetArea()
return _length * _width;
public void Display()
Console.WriteLine("Length: {0}", _length);
Console.WriteLine("Width: {0}", _width);
Console.WriteLine("Area: {0}", GetArea());