标签:
package 面向对象编程; 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(1,5); System.out.println("矩形的面积="+myJX.getMianJi()); } }
标签:
原文地址:http://www.cnblogs.com/yangchengyu314/p/5244156.html