预先编程 [英] Advance Programming

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

问题描述

与在数组中导航相比,您将如何在arrayList,Hashtable列表中进行导航?

how would you navigate through the list of an arrayList, Hashtable compared with navigating through an array?

推荐答案

这实际上取决于您想要的是什么.可以,但是为了简单起见,请查看For Next循环或For Each的所有内容以及其他任何方法.
It really depends on what it is that you want to do but for plain old look at all the content either of For Next loop or For Each works as well as any other method.


请勿使用ArrayList和HashTable.他们已经过时了.改用列表和字典:
Don''t use ArrayList and HashTable. They are outdated. Use List and Dictionary instead:
Dim x As New List(Of String) From {"a", "b"}
Dim y As New Dictionary(Of String, Integer) From {{"C", 3}, {"D", 8}}
For Each item As String In x
	MessageBox.Show(item)
Next
For Each key As String In y.Keys
	MessageBox.Show(key + ", " + y(key).ToString())
Next


有很多方法可以导航"这些集合类型,但这是一种方法.


There are many ways to "navigate" those collection types, but that''s one way.


这篇关于预先编程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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