当前位置: 技术问答>java相关
简单问题请回答
来源: 互联网 发布时间:2015-02-20
本文导语: 15.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){}; 9.which method ...
15.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){};
9.which method is an appropriate wey to determine the cosine of 42 degrees?
A.double d = Math.cos(42);
B.double d = Math.cosine(42);
C.double d = Math.cos(Math.toRadians(42));
D.double d = Math.cos(Math.toDegrees(42));
E.double d = Math.cosine(Math.toRadians(42));
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){};
9.which method is an appropriate wey to determine the cosine of 42 degrees?
A.double d = Math.cos(42);
B.double d = Math.cosine(42);
C.double d = Math.cos(Math.toRadians(42));
D.double d = Math.cos(Math.toDegrees(42));
E.double d = Math.cosine(Math.toRadians(42));
|
第一个选D。abstract声明为抽象方法,无法实例化,必须由子类实现。
第二个选C。Math.cos()方法的参数是double(弧度),返回值也是double。因此要调用Math.toRadians()将角度转换成弧度。
顺便祝SCJP考试顺利!^_^
第二个选C。Math.cos()方法的参数是double(弧度),返回值也是double。因此要调用Math.toRadians()将角度转换成弧度。
顺便祝SCJP考试顺利!^_^
|
9. c
15. d
15. d