首页试题详情
难度: 使用次数:138更新时间:2026/03/16
1.
在Visual Basic中,如何定义一个接受两个整数参数并返回它们之和的函数?
A.Function Sum(a As Integer, b As Integer) As Integer
B.Sub Sum(a As Integer, b As Integer) As Integer
C.Public Function Sum(a, b) As Integer
D.Function Sum(a As Integer, b) As Integer
题型:选择题 知识点:第九章 面向对象程序设计
【答案】
A
【解析】
Visual Basic中定义函数时,参数类型需明确指定,使用Function关键字而非Sub,并且明确返回类型为Integer。

查看答案和解析

支付 ¥0.1 即可查看此题答案和详细解析

低至 ¥0.1 起

类题推荐:

未分类