以下几行是什么意思? [英] What does the following line means ?

查看:129
本文介绍了以下几行是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下几行是什么意思?请解释或参考...


What does the following line means ? Please explain or refer...


int candidateID;
object[] param = new object[1]
 {
 candidateID 

};





问候.





Regards.

推荐答案

除了已经指出的问题之外,该代码甚至都不会编译.使用尚未分配的变量会导致编译时错误.

-MRB
Apart from what has been already pointed out to you this code would''nt even compile. Using a variable which has not yet been assigned to is a compile time error.

-MRB


做的是创建变量,该变量可以引用称为param的对象数组,并为其分配一个新的对象数组(包含单个对象),并进行预定义该对象数组的内容为单个整数(candidateID)

您最终得到的param指的是包含整数的对象的单个元素数组.

用图片解释起来很容易...:笑:
What is does is create variable which can reference an array of objects, called param, assigns a new array array of objects (containing a single object) to it, and predefines the contents of that object array to a single integer (candidateID)

You end up with param referring to a single element array of objects which contains an integer.

This is a lot easier to explain with pictures...:laugh:


您已经初始化了一个元素数组并为其添加了一个值.
一个值是变量candidateID内的值,在这种情况下为零.

另外,请在此处阅读 [
You have initialized a single element array and added one value to it.
That one value is the value inside variable candidateID and is zero in this case.

Also, read here[^].


这篇关于以下几行是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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