« Home « Kết quả tìm kiếm

Classes, Top-Level Classes, and Instances Basically


Tóm tắt Xem thử

- For example, an instance of the Array class (an Array object) can store multiple pieces of information in numerically indexed locations (myArray[0],.
- How can the array do this? It knows how to do this because it was defined that way by the Array class.
- The Array class has hidden logic and definitions (code) that work behind the scenes to define the way an Array object works and how it's used.
- The action to the right of the equals sign, new Array() in this example, executes the constructor method of the Array class.
- You cannot use the Array class directly.
- When creating the array instance, the Array class creates an object and then populates it with properties and methods.
- In a sense, the Array class is similar to a factory for array objects.
- On the other hand, arrays store unique data, so it wouldn't make sense to access the Array class directly because you would only be able to have one array.

Xem thử không khả dụng, vui lòng xem tại trang nguồn
hoặc xem Tóm tắt