- 10
- 0
- 约36.91万字
- 约 39页
- 2016-12-11 发布于河南
- 举报
Simulated Test of SCJP for JAVA2 PlatFORM
(only for training)
1. 1) public class ReturnIt{
2) returnType methodA(byte x, double y){
3) return (short)x/y*2;
4) }
5) }
what is valid returnType for methodA in line 2?
Answer:double //在进行运算时自动提升为最高级别
2. 1) class Super{
2) public float getNum(){return 3.0f;}
3) }
4)
5) public class Sub extends Super{
6)
7) }
which method, placed at line 6, will cause a compiler error?
A. public float getNum(){return 4.0f;}
B. public void getNum(){}
C. public void getNum(double d){}
D.
原创力文档

文档评论(0)