摘要: 曾学过c++,但是对这些异常捕捉不是很了解,通过别的编程语言了解 public class newclass { public static void main(String[] args) { try {int [] arr=new int[5]; arr[1]=0; // arr[10]=1; 阅读全文
posted @ 2020-01-09 15:38 世界を変える御宅族 阅读(501) 评论(0) 推荐(0) 编辑
摘要: 1.定义接口圆形CircleShape(),其中定义常量PI,默认方法area计算圆面积。 2.定义圆形类Circle实现接口CircleShape,包含构造方法与求周长方法。 3.定义圆柱继承Circle实现接口CircleShape,包含构造方法,圆柱表面积,体积。 4.从控制台输入圆半径,输出 阅读全文
posted @ 2020-01-09 11:34 世界を変える御宅族 阅读(585) 评论(0) 推荐(0) 编辑
摘要: 1 public class TEST { 2 3 public static void main(String[] args) { 4 Teacher t1=new Teacher(50,"刘三","教师"); 5 Worker t2=new Worker(30,"赵四","工人"); 6 t1. 阅读全文
posted @ 2020-01-09 09:08 世界を変える御宅族 阅读(448) 评论(0) 推荐(0) 编辑