正在加载图片...
Arrays of objects r An array of primitive data is a powerful tool, but even more powerful is an array of objects By combining the power of arrays and objects, we can structure programs in a clean and logical organization r If we have only arrays of primitives then to represent a collection of Person or Account objects for example, we need to use several different arrays, one for names, one for addresses, and so forth t is very cumbersome and error-prone r An array of person objects or an array of Account objects will result in a more concise and easier-to understand code C 2000 McGraw-Hill Introduction to Object-Oriented Programming with Java--Wu Chapter 9-10© 2000 McGraw-Hill Introduction to Object-Oriented Programming with Java--Wu Chapter 9 - 10 Arrays of Objects An array of primitive data is a powerful tool, but even more powerful is an array of objects. By combining the power of arrays and objects, we can structure programs in a clean and logical organization. If we have only arrays of primitives, then to represent a collection of Person or Account objects, for example, we need to use several different arrays, one for names, one for addresses, and so forth. This is very cumbersome and error-prone. An array of Person objects or an array of Account objects will result in a more concise and easier-to￾understand code
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有