高级编程语言 Java之集合与对象
来源:wenku7.com 资料编号:WK711309 资料等级:★★★★★ %E8%B5%84%E6%96%99%E7%BC%96%E5%8F%B7%EF%BC%9AWK711309
以下是资料介绍,如需要完整的请充值下载。
1.无需注册登录,支付后按照提示操作即可获取该资料.
2.资料以网页介绍的为准,下载后不会有水印.资料仅供学习参考之用. 密 保 惠 帮助
资料介绍
高级编程语言 Java之集合与对象(中文2900字,英文2100字)
如果程序只包含固定数量的对象,并且其生命周期都已知,那么这个程序就实在太简单了。
通常,你的程序会根据运行时才知道的条件创建新对象。不到运行期,不会知道所需对象的数量,甚至不知道确切的类型。为解决这个普遍的编程问题,需要能够在任意时刻,任意位置,创建任意数量的对象。所以,你就不能指望创建具名的引用来持有每一个对象:
High-level programming language Java Collections of
Objects
It’s a fairly simple program that has only a fixed quantity of objects with known lifetimes.
In general, your programs will always be creating new objects based on some criteria that will be known only at the time the program is running. You won’t know until runtime the quantity or even the exact type of the objects you need. To solve the general programming problem, you need to be able to create any number of objects, anytime, anywhere. So you can’t rely on creating a named reference to hold each one of your objects:
MyObject myReference;
since you’ll never know how many of these you’ll actually need. |