阅读以下说明和Java源程序,将应填入(n)处的字句写在对应栏内。 【说明】 以下

题型:问答题

问题:


阅读以下说明和Java源程序,将应填入(n)处的字句写在对应栏内。
【说明】
以下程序能够计算三角形、矩形和正方形的周长并输出。
程序由5个类组成:AreaTest是主类,类Triangle、Rectangle和Square分别表示三角形、矩形和正方形,抽象类Figure提供了一个计算周长的抽象方法。
【程序】
public class girthTest{
public static void main (String args[]){
Figure[]figures={
new Triangle (2,3,3),new Rectangle(5,8),new Square(5)
};
for(int i=0;i<figures.length;i++){
System.out.println(figures[i]+"girth="+figures[i].getGirth());
}
}
}
public abstract class Figure{
public abstract double getGirth();
}
public class Rectangle extends (1) {
double height;
double width;
public Rectangle(double height,double width){
this.height=height;
this.width=width;
}
public String toString(){
return "Rectangle:height="+height+",width="+width+":";
}
public double getGirth(){
return (2)
}
}
public class Square extends (3) {
public Square(double width){
(4)
}
public Stdng toString(){
return "Square:width=’+width+":";
}
}
public class Triangle extends (5) {
double la;
double lb;
double lc;
public Triangle(double la,double lb,double lc){
this.la=la;this.lb=lb;this.lc=lc;
}
public String toString(){
return "Triangle:sides=" +la+"," +lb+"," +lc+":";
}
public double getGirth(){
return la+lab+lc;
}
}

考点:计算机软件水平考试初级程序员程序员
题型:问答题

设计教学计划应遵循的原则包括()。

A.普遍性原则

B.最优化原则

C.刨新性原则

D.针对性原则

E.适应性原则

题型:问答题

假设银行活期存款月息为0.8‰,某储户将2000元人民币存入银行,一年后他可获得本息共_____元。( )

A.11.2

B.2001.6

C.2011.2

D.1988.8

题型:问答题

单件小批生产中应多用专用机床以提高效率。

题型:问答题

在遥测系统中,UPS电源有什么作用?

题型:问答题

空气栓塞导致死亡的原因是空气进入并阻塞哪条血管()

A.肺静脉

B.肺动脉

C.上腔静脉

D.下腔静脉

E.主动脉

更多题库