题目内容

设有如下代码:
class Base{}
public class MyCast extends Base{
static boolean b1=false;
static int i = -1;
static double d = 10.1;
public static void main(String argv[]){
MyCast m = new MyCast();
Base b = new Base();
//Here
}
}
则在 //Here处插入哪个代码将不出现编译和运行错误。

A. b=m;
B. m=b;
C. d =i;
D. b1 =i;

查看答案
更多问题

纳税人销售货物、劳务、有形动产租赁服务或者进口货物适用的税率为()。

设有类定义如下:
class InOut{
String s= new String("Between");
public void amethod(final int iArgs){
int iam;
class Bicycle{
public void sayHello(){
//Here
}
}
}
public void another(){
int iOther;
}
}
以下哪些语句可以安排在//Here处 ?

A. System.out.println(s);
B. System.out.println(iOther);
C. System.out.println(iam);
D. System.out.println(iArgs);

设有如下代码:
interface IFace{}
class CFace implements IFace{}
class Base{}
public class ObRef extends Base{
public static void main(String argv[]){
ObRef bj = new ObRef();
Base b = new Base();
Object obj1 = new Object();
IFace obj2 = new CFace();
//Here
}
}
则在 //Here处插入哪个代码将不出现编译和运行错误。

A. obj1=obj2;
B. b=obj;
C. obj=b;
D. obj1=b;

试完成下述程序片段:public class Point(){ int x,y;public Point(int x,int y){ =x; =y;}......}

A. Point.x Point.y
B. 无解
C. x1 y1
D. this.x this.y

答案查题题库