HelloWorld?c
HelloWorld?
HelloWorld!c
HelloWorld!
第1题:
下面程序的运行结果是 ______。 #include<iostream.h> class A{ public virtual、~(){ cout<<”call A:: ~A()”<<end1;} }; class B:public A{ B(int i){p=new char[i]:} -B(){ delete[)p; Cout<<”call B:: ~B()”; } }; void main() { A*a=new B(8); Delete a; }
A.call B:: ~B()
B.call B:: ~B()
C.call A:~A()
D.call A::~A()
第2题:
阅读下面代码 public class Person { static int arr[]=new int[10]; public static void main(String args) { System.out.println(arr[9]); } } 该代码的运行结果是
A.编译时将产生错误
B.编译时正确,运行时将产生错误
C.输出零
D.输出空
第3题:
下面运行程序后,单击命令按钮,输出的结果是 【 】 。
Private Sub Command1_Click()
Dim a%(1 To 5),i%, s#
For i=1 To 5
a(i)=i
Next
s=Fun(a)
Print "s="; s;
End Sub
Function Fun(a() As Integer)
Dim t#, i%
t=1
For i=LBound(a) To UBound(a)
t=t a(i)
Next
Fun=t
End Function
第4题:
下面程序运行时,单击窗体后,窗体上显示的结果是( )。 Private Sub Form_Click Dim I As Integer Dim sum As Long Dim t1 As Long t1=1:sum=0 For 1=1 To 3 t1=t1*I sum=sum+t1 Next I Print sum End Sub
A.3
B.9
C.5
D.6
第5题:
第三题:请看如下代码
<%
TestString="Test"
TestA
TestB
Response.write TestString
Sub TestA()
TestString="TestA"
End Sub
Sub TestB()
Dim TestString
TestString="TestB"
End Sub
%>
这段代码执行后,运行结果是什么?并解释一下为什么?
第6题:
阅读下面代码 public class Test implements Runnable { public void run(Thread t) { System.out.println("Running"); } public static void main(String[] args) { Thread tt=new Thread(new Test()); tt.start(); } } 代码运行的结果是
A.将抛出一个异常
B.没有输出并正常结束
C.输出“Running”并正常结束
D.程序第2行将出现一个编译错误
第7题:
What’s the final result?
(下面这段代码的最终运行结果是什么)
double expectedValue = 1/2;
if(expectedValue > 0)
{
expectedValue = expectedValue + 0.5;
}
Console.WriteLine(expectedValue);
第8题:
阅读下列代码
Public class Person{
Static int arr[ ] = new int (10);
Public static void main (String args ) {
System.out.println(arr[9]);
}
}
该代码运行的结果是
A )编译时将产生错误
B )编译时正确,运行时将产生错误
C )输出 0
D )输出空
第9题:
编译并运行下面的Java代码段输出结果是()。
A.代码无法编译,因为switch语句没有一个合法的表达式
B.adefault
C.a
D.default
第10题:
A.2
B.3
C.4
D.5