using System;
namespace RectangleApplication
{
class Rectangle
{
double length;
double width;
public void accecptnum(){
length=4.0;
width=3.0;
}
public double getarea(){
return length*width;
}
public void display(){
Console.WriteLine("Length:{0}",length);
Console.WriteLine("Width:{0}",width);
Console.WriteLine("Area:{0}",getarea());
}
}
class ExecuteRectangle
{
static void Main(string[] args)
{
Rectangle r = new Rectangle();
r.accecptnum();
r.display();
Console.ReadLine();
}
}
}
运行结果: