相当于 VB.NET 中的 Array()? [英] Equivalent of Array() in VB.NET?

查看:27
本文介绍了相当于 VB.NET 中的 Array()?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 VB6 中你可以这样做:

In VB6 you can do this:

Dim a As Variant
a = Array(1, 2, 3)

你能在 VB.NET 中用特定类型做类似的事情吗?:

Can you do a similar thing in VB.NET with specific types, like so?:

Dim a() As Integer
a = Array(1, 2, 3)

推荐答案

Dim a() As Integer = New Integer() {1, 2, 3}

这篇关于相当于 VB.NET 中的 Array()?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆