记录
Jay_27
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
java知识点(待改进)
1、内部类: 2、枚举类 1.枚举也可以象一般的类一样添加方法和属性 2.可以为它添加静态和非静态的属性或方法 3.可以有构造方法 3、初始化数组 int[] a = new int[5]; 4、super关键字 1.super关键字是在子类对象内部指代其父类对象的引用 2.super关键字,只能指代子类的直接父类,不能指代父类的父类 3.子类通过super关键字,能...原创 2021-11-14 21:22:31 · 2623 阅读 · 0 评论 -
C语言—计时程序运行时间 #include <time.h>
头文件#include <time.h> clock_t start, end;//定义 /*开始时间*/ start = clock(); ... ... end = clock(); /*结束时间*/ 得到 运行时间double time = (double)(end - start)/CLOCKS_PER_SEC; ...原创 2021-10-24 17:38:45 · 3153 阅读 · 0 评论 -
三角形类 (Triangle class)
设计一个GeometricObject类。该类包括: (1)两个名为color(颜色)、filled(是否填充)的数据域,即Field。 ps:数据类型:char字符;String 字符串;boolean true/false (2)一些方法。类c语言的使用 ps:构造方法:无类型,其名同类名 设计一个名为Triangle的类来扩展GeometricObject类。该类包括: ps:类声明:扩展/继承—extends:class <有扩展のname> ex...原创 2021-10-22 14:02:50 · 1002 阅读 · 0 评论 -
形状 ( Shape )
题目: Please write a program to compute the superfacial area and volume of the cylinder, sphere, cube and cuboid. INPUT: Input a integer N at the first line, with N testings followed, each testing has four lines input, first is the radius, height of the原创 2021-10-22 19:52:42 · 145 阅读 · 0 评论 -
几何对象的面积之和
设计一个GeometricObject类。 再设计两个GeometricObject的子类:Rectangle、Circle。 Rectangle:变量length、width;Circle:变量radius。 求数组中所有几何对象的面积之和:用public static double sumArea(GeometricObject[] a) 要求:创建四个对象(两个矩形对象和两个圆的对象)的数组,然后用sumArea方法求总面积。 解: tip:Math.PI;构造方法;super调父类量;数原创 2021-10-22 22:06:50 · 2953 阅读 · 0 评论
分享