java,编写一个矩形类,

package org.hanqi.pn0120;

public class JuXing {
    double chang;
    double kuan;
    JuXing(double chang,double kuan)
    {
        this.chang=chang;
        this.kuan=kuan;
    }
    //计算面积
    double getMianJi()
    {
        return this.chang*this.kuan;
    }
    public static void main(String[] args)
    {
        JuXing myJX=new JuXing(10,5);
        System.out.println(""+myJX.getMianJi());
        
    }

}

 

posted @ 2016-03-05 09:42  什么玩楞啊,我叫旺仔  阅读(1139)  评论(0编辑  收藏  举报