摘要: 练习2:根据下图实现类。在TestCylinder类中创建Cylinder类的对象,设置圆柱的底面半径和高,并输出圆柱的体积 import scala.beans.BeanProperty object work04 { def main(args: Array[String]): Unit = { 阅读全文
posted @ 2019-12-07 00:24 梁衍 阅读(486) 评论(0) 推荐(0) 编辑
摘要: 练习1 编写computer类,包含CPU、内存、硬盘等属性,getDetails方法用于返回computer的详细信息。 编写PC子类,继承computer类,添加特有属性【品牌brand】 编写notepad类,继承computer类,添加特有属性【颜色color】 编写test object, 阅读全文
posted @ 2019-12-07 00:16 梁衍 阅读(809) 评论(0) 推荐(0) 编辑