java类与对象基础实验(一)
importjava.util.Scanner;classRectangle{doublelength,width;Rectangle(){}Rectangle(doublealength,doubleawidth){length=alength;width=awidth;}publicdoubleperimeter(){return(length+width)*2;}publicdoublearea(){returnlength*width;}}
下载地址
用户评论