网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)
多选题
求平方根方法public static double sqrt (double a)可以传递的参数类型有哪些?()
A

byte

B

float

C

String

D

long


参考答案

参考解析
解析: 暂无解析
更多 “多选题求平方根方法public static double sqrt (double a)可以传递的参数类型有哪些?()AbyteBfloatCStringDlong” 相关考题
考题 请完成下列Java程序。程序的功能是利用迭代法求一个数的平方根(求平方根的迭代公式为:Xn+1=1/2(Xn+a/Xn)).注意:请勿改动main()主方法和其他已有的语句内容,仅在下划线处填入适当的语句。public class PingFangGen{public static void main(String args[]){System. out. println(Math, sqrt(2.0));}static double sqrt(______){double x=1.0do{_______}while( Math. abs(x*x-a)/a>le-6)return x;}}

考题 阅读以下说明和Java程序,将应填入(n)处的字句写在对应栏内[说明]以下程序的功能时三角形、矩形和正方形的面积输出。程序由5个类组成:areatest是主类,类Triangle,Rectangle和Square分别表示三角形、矩形和正方形,抽象类Figure提供了一个计算面积的抽象方法。[Java程序]public class areatest {public static viod 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+"area="+Figures.getarea());}}}public abstract class figure {public abstract double getarea();}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 getarea(){return (2)}}public class square exends (3){public square(double width){(4);}public string tostring(){return"square:width="+width":";}}public class triangle entends (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 get area(){double s=(la+lb+lc)/2.0;return math.sqrt(s*(s-la)*(s-lb)*(s-lc));}}

考题 阅读以下说明和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;}}

考题 阅读下列Java程序和程序说明,将应填入(n)处的字句写在对应栏内。【说明】下面的程序先构造Point类,再顺序构造Ball类。由于在类Ball中不能直接存取类Point中的xCoordinate及yCoordinate属性值,Ball中的toString方法调用Point类中的toString方法输出中心点的值。在MovingBall类的toString方法中,super.toString调用父类Ball的toString方法输出类Ball中声明的属性值。public class Point{private double xCoordinate;private double yCoordinate;public Point 0 }public Point(ouble x, double y){xCoordinate = x;yCoordinate = y;}public String toString(){return "( + Double.toString(Coordinate)+ ","+ Double.toString(Coordinate) + ");}//other methods}public class Ball{(1); //中心点private double radius; //半径private String colour; ///颜色public Ball() { }public Ball(double xValue, double yValue, double r)// 具有中心点及半径的构造方法{center=(2);//调用类Point 中的构造方法radius = r;}public Ball(double xValue, double yValue, double r, String c)// 具有中心点、半径及颜色的构造方法{(3);//调用3个参数的构造方法colour = c;}public String toString(){return "A ball with center" + center, toString() + ", radius"+ Double.toString(radius) + ", colour" + colour;}//other methods}public class MovingBall. (4){private double speed;public MovingBall() { }public MovingBall(double xValue, double yValue, double r, String e, double s){(5);// 调用父类Ball中具有4个参数的构造方法speed = s;}public String toString( ){ return super, toString( ) + ", speed "+ Double.toString(speed); }//other methods}public class Tester{public static void main(String args[]){MovingBall mb = new MovingBall(10,20,40,"green",25);System.out.println(mb);}}

考题 下列是定义一个接口ITF的程序,在横线处应填入的选项是 ( )public interface ITF{public static final double PI=3.14,public ______ double area(double a,double b);}A.interfaeeB.staticC.finalD.abstract

考题 求平方根方法publicstaticdoublesqrt(doublea)可以传递的参数类型有哪些?() A.byteB.floatC.StringD.long

考题 阅读以下函数说明和Java代码,将应填入(n)处的字句写在对应栏内。【说明】下面的程序先构造Point类,再顺序构造Ball类。由于在类Ball中不能直接存取类Point中的xCoordinate及yCoordinate属性值,Ball中的toString方法调用Point类中的toStrinS方法输出中心点的值。在MovingBsll类的toString方法中,super.toString调用父类Ball的toString方法输出类Ball中声明的属性值。【Java代码】//Point.java文件public class Point{private double xCoordinate;private double yCoordinate;public Point(){}public Point(double x,double y){xCoordinate=x;yCoordinate=y;}public String toStrthg(){return"("+Double.toString(xCoordinate)+","+Double.toString(yCoordinate)+")";}//other methods}//Ball.java文件public class Ball{private (1);//中心点private double radius;//半径private String color;//颜色public Ball(){}public Ball(double xValue, double yValue, double r){//具有中心点及其半径的构造方法center=(2);//调用类Point中的构造方法radius=r;}public Ball(double xValue, double yValue, double r, String c){//具有中心点、半径和颜色的构造方法(3);//调用3个参数的构造方法color=c;}public String toString(){return "A ball with center"+center.toString()+",radius "+Double.toString(radius)+",color"+color;}//other methods}class MovingBall (4) {private double speed;public MovingBall(){}public MoyingBall(double xValue, double yValue, double r, String c, double s){(5);//调用父类Ball中具有4个参数的构造方法speed=s;}public String toString(){return super.toString()+",speed"+Double.toString(speed);}//other methods}public class test{public static void main(String args[]){MovingBall mb=new MovingBall(10,20,40,"green",25);System.out.println(mb);}}

考题 阅读以下说明和Java源程序,将应填入(n)处的字句写在答题纸的对应栏内。说明以下程序的功能是计算三角形、矩形和正方形的面积并输出。程序由5个类组成:AreaTest是主类,类Triangle、Rectangle和Square分别表示三角形、矩形和正方形,抽象类Figure提供了一个计算面积的抽象方法。程序public class AreaTest{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.1ength;i++){System.out.println(figures[i]+"area="+figures[i].getArea());}}}public abstract class Figure{public abstract double SetAJea();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 getArea() { return (2);} } public class Square extends (3) {public Square(double width) {(4);}public String 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 getArea() {double s=(la+lb+lc)/2.0;return Math.sqrt(s*(s-la)*(s-lb)*(s?1c));}}

考题 下列是定义一个接口ITF的程序,在横线处应填入的选项是( )。 publid interface ITF { public static final double PI=3.14; public______double area(double a,double B) ; }A.interfaceB.staticC.finalD.abstract

考题 下列程序的执行结果为【 】。include class Point{public:Point(double i, double j) 下列程序的执行结果为【 】。include <iostream. h>class Point{public:Point(double i, double j) { x=i; y=j;}double Area() const { return 0.0;}private:double x, y;};class Rectangle: public Point{public:Rectangle(double i, double j, double k, double 1)double Area() const {return w * h;}private:double w, h;};Rectangle: :Rectangle(double i, double j, double k. double 1): Point(i,j).{w=k, h=1}void fun(Point s){cout<<s. Area()<<end1;}void main( ){Rectangle rec(3.0, 5.2, 15.0. 25.0);fun(rec)}

考题 在下列方法的定义中,正确的是 ( )A.public double x(){..;return false;}B.public static int x(double y){...}C.void x(doubled){...;return d}D.public static x(double a){..}

考题 阅读以下说明和c++代码,将应填入(n)处的字句写在对应栏内。【说明】现要编写一个画矩形的程序,目前有两个画图程序:DP1和DP2,DP1用函数draw_a_line(x1, y1,x2,y2)画一条直线,DF2则用drawline(x1,x2,y1,y2)画一条直线。当实例画矩形时,确定使用DP1还是DP2。为了适应变化,包括“不同类型的形状”和“不同类型的画图程序”,将抽象部分与实现部分分离,使它们可以独立地变化。这里,“抽象部分”对应“形状”,“实现 部分”对应“画图”,与一般的接口(抽象方法)与具体实现不同。这种应用称为Bridge(桥接)模式。图9-7显示了各个类间的关系。这样,系统始终只处理3个对象:Shape对象、Drawing对象、DP1或DP2对象。以下是 C++语言实现,能够正确编译通过。【C++代码】class DP1{public:static void draw_a_line(double x1, double y1,double x2, double y2){//省略具体实现});class DP2{public:static void drawline(double x1, double x2,double y1, double y2){//省略具体实现}};class Drawing{public:(1) void drawLine(double x1,double y1,double x2,double y2)=0;};class V1Drawing:public Drawing{public:void drawLine(double x1, double y1,double x2, double y2){DP1::draw_a_line(x1,y1,x2,y2);}};class V2Drawing:public Drawing{public:void drawLine(double x1, double y1, double x2, double y2){(2);}};class Shape{private:(3) _dp;public:Shape(Drawing *dp);virtual void draw()=0;void drawLine(double x1, double y1, double x2, double y2);};Shape::Shape(Drawing *dp){_dp = dp;}void Shape::drawLine(double x1, double y1, double x2, double y2){ //画一条直线(4);}class Rectangle: public Shape{private:double _x1,_y1,_x2,_y2;public:Rectangle(Drawing *dp, double x1, double y1,double x2, double y2);void draw();};Rectangle::Rectangle(Drawing *dp, double x1, double y1, double x2, double y2):(5){_x1=x1;_y1=y1;_x2=x2;_y2=y2;}void Rectangle::draw(){//省略具体实现}

考题 下面哪个方法与题目中的不是重载方法public int max(int x,int y) A.public double max(double x,double y)B.publicintmax(intn,int k)C.publicintmax(intx,int y, int z)D.public double max(double n,double k)

考题 Which will declare a method that is available to all members of the same package and can be referenced  without an instance of the class?()  A、 Abstract public void methoda();B、 Public abstract double methoda();C、 Static void methoda(double d1){}D、 Public native double methoda(){}E、 Protected void methoda(double d1){}

考题 Which two are valid declarations within an interface definition?() A、 void methoda();B、 public double methoda();C、 public final double methoda();D、 static void methoda(double d1);E、 protected void methoda(double d1);

考题 Which will declare a method that forces a subclass to implement it? () A、 Public double methoda();B、 Static void methoda (double d1) {}C、 Public native double methoda();D、 Abstract public void methoda();E、 Protected void methoda (double d1){}

考题 在接口中以下哪条定义是正确的?()A、void methoda();B、public double methoda();C、public final double methoda();D、static void methoda(double d1);E、protected void methoda(double d1);

考题 以下声明合法的是()A、default  String  sB、public  final  static  native  int  w( )C、abstract  double  dD、abstract  final  double  hyperbolicCosine( )

考题 下列方法定义中,方法头不正确的是()。A、public static x(double a)B、public static int x(double y)C、void x(double d)

考题 在可变参数过程中的参数是()类型,因此可以把任何类型的实参传递给该过程。A、IntegerB、StringC、VariantD、Double

考题 public class OuterClass {  private double d1  1.0;  //insert code here   }   You need to insert an inner class declaration at line2. Which two inner class declarations are valid?() A、 static class InnerOne {  public double methoda() {return d1;}  }B、 static class InnerOne {  static double methoda() {return d1;} }C、 private class InnerOne {  public double methoda() {return d1;} }D、 protected class InnerOne {  static double methoda() {return d1;} }E、 public abstract class InnerOne {  public abstract double methoda();  }

考题 您已创建一个名为 CalcSalary,将确定 Certkiller.com 员工的薪酬类的责任。CalcSalary 类包括员工的薪酬递增和递减的方法。下面的代码包含在 CalcSalary 类中:()public class CalcSalary {// for promotionspublic static bool IncrementSalary (Employee Emp, double Amount){if (Emp.Status == QuarterlyReview.AboveGoals)Emp.Salary += Amount;return true;A、public delegate bool Salary (Employee Emp, double Amount);B、public bool Salary (Employee Emp, double Amount);C、public event bool Salary (Employee Emp, double Amount);D、public delegate void Salary (Employee Emp, double Amount);

考题 单选题Which will declare a method that forces a subclass to implement it? ()A  Public double methoda();B  Static void methoda (double d1) {}C  Public native double methoda();D  Abstract public void methoda();E  Protected void methoda (double d1){}

考题 单选题Which will declare a method that is available to all members of the same package and can be referenced without an instance of the class?()A  Abstract public void methoda();B  Public abstract double methoda();C  Static void methoda(double d1){}D  Public native double methoda()  {}E  Protected void methoda(double d1)  {}

考题 单选题下列方法定义中,方法头不正确的是()。A public static x(double a)B public static int x(double y)C void x(double d)

考题 单选题Which will declare a method that is available to all members of the same package and be referenced without an instance of the class?()A  abstract public void methoda ();B  public abstract double inethoda ();C  static void methoda (double dl) {}D  public native double methoda () {}E  protected void methoda (double dl) {}

考题 多选题求平方根方法public static double sqrt (double a)可以传递的参数类型有哪些?()AbyteBfloatCStringDlong

考题 多选题1. public class OuterClass {  2. private double d1 = 1.0;  3. // insert code here  4. }  Which two are valid if inserted at line 3?()Astatic class InnerOne { public double methoda() { return d1; } }Bstatic class InnerOne { static double methoda() { return d1; } }Cprivate class InnerOne { public double methoda() { return d1; } }Dprotected class InnerOne { static double methoda() { return d1; } }Epublic abstract class InnerOne { public abstract double methoda(); }