站内搜索: 请输入搜索关键词
当前页面: 图书首页 > NET For Java Developers Migrating To C#

NET For Java Developers Migrating To C#

[ directory ] Previous Section Next Section

Chapter 11. Working with Arrays

Arrays are one of the most fundamental and commonplace data structures of any programming language. Both C# and Java treat arrays as first-class objects, meaning that arrays are allocated on the heap. Although arrays are treated as objects by the runtime, for the most part you use arrays primarily as containers for holding elements, as in this example:

int[] arr = new int[5];

Although arr is an object, you would not inherit from it; instead, you would use arr primarily for storing five integers.

    [ directory ] Previous Section Next Section