什么是vb.net相当于C#的“变种”的关键字 [英] What is the vb.net equivalent of the C# “var” keyword

查看:180
本文介绍了什么是vb.net相当于C#的“变种”的关键字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

例如。我怎么VB.Net到静态类型一个局部变量是静态型右侧的前pression有分配的一面?

E.g. how do I get VB.Net to statically type a local variable to be the static type of the expression on the right had side of the assignment?

推荐答案

这样的:

暗淡 myVar的= 3

Dim myVar = 3

您还需要

选项推断在

(在文件的顶端或在项目设置)

(At the top of the file or in project settings)

请参阅本地类型推断

这篇关于什么是vb.net相当于C#的“变种”的关键字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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