单选题 Access
题号 #2253583

窗体中有命令按钮Commandl,事件过程如下:
PublicFunction f(x As Integer)As Integer
Dim Y AsInteger
X=20
y=2
f= X *Y
End Function
PrivateSub Commandl_Click(  )
Dim y As Integer
static x As Integer
x=10
y=5
y=f(x)
Debug.Print x;y
End Sub
运行程序,单击命令按钮,则立即窗口中显示的内容是(   )

进入在线模考

参考答案

B

答案解析

本题考查的是变量的作用域及生存周期,在子函数里定义的变量,生存期在子函数范围内,X属于静态变量。

你可能感兴趣的试题

找试题 · 找答案 · 找资料 在线模考