求长方形的面积:
public class Shao{
public static void main(String[] args)
{
Shao a=new Shao();
a.Shao(1,2);
System.out.println(a.getShao());
}
int chang;
int kuan;
public void Shao()
{
chang=1;
kuan=1;
}
public void Shao(int newChang,int newKuan)
{
chang=newChang;
kuan=newKuan;
}
public int getShao()
{
return kuan*chang;
}
}