题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2023-12-03 19:41:08

[多选题]设有如下代码:
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 Base{}Public clas"的相关试题:

[单选题] 设有类定义如下:
Class Base{
Public Base(int i){}
}
Public class MyOver extends Base{
Public static void main(String arg[]){
MyOver m = new MyOver(10);
}
MyOver(int i){
Super(i);
}
MyOver(String s, int i){
This(i);
//Here
}
}
以下哪条语句可以安排在 //Here 处 ?
A. MyOver m = new MyOver();
B. super();
C. this("Hello",10);
D. Base b = new Base(10);
[多选题] 设有如下代码:
Interface IFace{}
Class CFace implements IFace{}
Class Base{}
Public class ObRef extends Base{
Public static void main(String argv[]){
ObRef obj = 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;
[单选题]已知: class Base { public Base(String s) { System.out.print(“B”); } } public class Derived extends Base { public Derived (String s) { System.out.print(“D”); } public static void main(String [] args) { new Derived (“C”); } } 那么结果为?
A.BD
B.DB
C.C
D.编译错误
[单选题]以下程序调试结果为:
Class Base{
Base(){
Int i = 100;
System.out.print (i);
}
}
Public class Pri extends Base{
Static int i = 200;
Public static void main(String argv[]){
Pri p = new Pri();
System.out.print(i);
}
}
A.编译错误
B.200
C. 100200
D. 100
[多选题]考虑如下代码:
Class Tree{}
Class Pine extends Tree{}
Class Oak extends Tree{}
Public class Forest {
Public static void main( String[] args ) {
Tree tree = new Pine();
If( tree instanceof Pine )
System.out.println( "Pine" );
If( tree instanceof Tree )
System.out.println( "Tree" );
If( tree instanceof Oak )
System.out.println( "Oak" );
Else
System.out.println( "Oops" );
}
}
则输出结果中有哪些?
A. Pine
B.Tree
C.Forest
D.Oops E .无输出
[单选题] 设有如下程序
Public class test {
Public static void main(String args[]) {
Integer intObj=Integer.valueOf(args[args.length-1]);
Int i = intObj.intValue();
If(args.length > 1)
System.out.println(i);
If(args.length > 0)
System.out.println(i - 1);
Else
System.out.println(i - 2);
}
}
运行程序 , 输入如下命令:
Java test 2
则输出为:
A. test
B. test -1
C. 0
D. 1
E. 2
[单选题] 以下程序的调试结果为?
class Base{
public final void amethod(){
System.out.println("amethod");
}
}
public class Fin extends Base{
public static void main(String argv[]){
Base b = new Base();
b .amethod();
}
}
A.编译指示带有 final 方法的类自己必须定义为 final
B.编译指示不能继承含有 final 方法的类
C.运行错误,原因是 Base 类没有定义为 final 类
D.运行输出 amethod
[单选题]以下程序的编译和运行结果为?
Abstract class Base{
Abstract public void myfunc();
Public void another(){
System.out.println("Another method");
}
}
public class Abs extends Base{
public static void main(String argv[]){
Abs a = new Abs();
a .amethod();
}
public void myfunc(){
System.out.println("My Func");
}
public void amethod(){
myfunc();
}
}
A.输出结果为 My Func
B.编译指示 Base 类中无抽象方法
C.编译通过,但运行时指示 Base 类中无抽象方法
D.编译指示 Base 类中的 myfunc 方法无方法体,没谁会喜欢该方法。
[单选题]题 (1.0分)
在窗体上添加一个命令按钮,编写如下代码.
Option Base 1
Private Sub Command1_Click
Dim a
A=Array(1,2,3,4)
J=1
For i=4 To1 Step -1
S=s+a(i)*j
J=j*10
Next i
Print s
End Sub
程序运行后,单击命令按钮,输出结果是
().
A.4321
B.12
C.34
D.1234
[多选题] 设有类定义如下:
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);
[多选题]如下代码表示轮椅旅客的是( )。
A. WCHC
B. WCHR
C. WCH
D. WCHS
[单选题]设有如下程序:
Private Sub Command1_Click()
Dim sum As Double,x As Double
Sum = 0
N = 0
For i = 1 To 5
X = n / i
N = n + 1
Sum = sum + x
Next
End Sub
该程序通过For循环计算一个表达式的值,这个表达式是().
A.1+1/2+2/3+3/4+4/5
B.1+1/2+2/3+3/4
C.1/2+2/3+3/4+4/5
D.1+1/2+1/3+1/4+1/5
[单选题]设有如下变量声明
Dim TestDate As Date
为变量TestDate正确赋值的表达方式是().
A.TestDate=#1/1/2008#
B.TestDate=#"1/1/2008"#
C.TestDate=date("1/1/2008")
D.TestDate=Format("m/d/yy","1/1/2008")
[单选题]题 (1.0分)
设有数组声明语句.
Option Base0
Dim b(-l To 10,2 To 9,20)As Integer
则数组B中共有()个元素.
A.1800
B.1848
C.2016
D.2310
[单选题]第281题 (1.0分)
设有如下程序.
Private Sub Command1_Click()
Dim sum As Double,x As Double
Sum = 0
N = 0
For i = 1 To 5
X = n / i
N = n + 1
Sum = sum + x
Next
End Sub
该程序通过For循环计算一个表达式的值,这个表达式是().
A.1+1/2+2/3+3/4+4/5
B.1+1/2+2/3+3/4
C.1/2+2/3+3/4+4/5
D.1+1/2+1/3+1/4+1/5
[单选题]第43题 (1.0分)
设有如下变量声明
Dim TestDate As Date
为变量TestDate正确赋值的表达方式是().
A.TestDate=#1/1/2008#
B.TestDate=#"1/1/2008"#
C.TestDate=date("1/1/2008")
D.TestDate=Format("m/d/yy","1/1/2008")

我来回答:

购买搜题卡查看答案
[会员特权] 开通VIP, 查看 全部题目答案
[会员特权] 享免全部广告特权
推荐91天
¥36.8
¥80元
31天
¥20.8
¥40元
365天
¥88.8
¥188元
请选择支付方式
  • 微信支付
  • 支付宝支付
点击支付即表示同意并接受了《购买须知》
立即支付 系统将自动为您注册账号
请使用微信扫码支付

订单号:

请不要关闭本页面,支付完成后请点击【支付完成】按钮
恭喜您,购买搜题卡成功
重要提示:请拍照或截图保存账号密码!
我要搜题网官网:https://www.woyaosouti.com
我已记住账号密码