创建一个List [英] create a List

查看:105
本文介绍了创建一个List的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hi


.net dont识别< tableclass>在以下命令中:

List< tableclass> list = MyCheckedList();



如何创建List< tableclass>



谢谢

hi
.net dont recognize <tableclass> in following command:
List<tableclass> list = MyCheckedList();

how can i create a List<tableclass>

thanks

推荐答案

你创建了函数MyCheckedList()了吗?如果是这样,它是否返回List类型的对象?如果不是那么它将永远不会起作用。



一些基础研究不会对这种事情造成不良影响!



阅读以下内容:

Google搜索结果因为这是开始研究和解决问题的地方! [ ^ ]

排名第一的Google结果,它有示例! [ ^ ]



将来,如果你正在尝试,请认真停下来思考一下编写代码,然后学习在发布之前查找内容ING。一旦你尝试了东西并遇到实际问题,那么考虑在这里发帖。并阅读常见问题解答! [ ^ ]
Have you created the function "MyCheckedList()" yet? If so, does it return an object of type List? if not then it will never work.

Some basic research does not go amiss with this sort of thing!

Read the following:
Google Search Results Because This is where research and problem solving starts![^]
Number 1 Google Result, it has examples![^]

In future, stop and think for a second, seriously, if you are attempting to write code, then learn to look things up before posting. Once you have tried stuff and are having actual problems then think about posting on here. And read the FAQ![^]






您可以在C#中创建一个List,将List的数据类型定义为String或Int或Double List。



请参阅下面的基本示例。



Hi,

You can create a List in C# be defining the Datatype of your List as String or Int or Double List.

See the Basic Sample below.

class Sample
  {
      static void Main(string[] args)
      {
          List<string> listNames = MyNameList();

      }

      private static List<string> MyNameList()
      {
          List<string> names = new List<string>();

          names.add("Veera");
          names.add("Boomi");
          names.add("Vijay");
          names.add("Venu");

          return names;
      }

  }


这篇关于创建一个List的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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