Title: Optional Video: java.util.Array.java
Course: CPS 261: Advanced Java Concepts ~ DL & MM MASTER > Section: Learning Units - Bb

Presentations and Videos

- Optional Video lecture video (Time: 15:00)
- Array Class document

- This video is for completeness and isn't needed to succed in cps261 (not on the final or in any homework).
- Although an ArrayList is more flexible, real arrays can be more efficient if you don't need the flexibility of dynamic sizes.
- Note that Arrays can directly work with primitives which is unlike ArrayLists which have to convert the primitive to the appropriate Wrapper class. For example, an int is converted to an Integer class. This gives Arrays an efficiency gain.
- The java.util.Array class provides many built in methods: sort, binarySearch, fill, copy routines, and others.
- The TryOutArrays.java class demonstrates using some of these methods with an array of ints, array of Strings and an array of Dog classes (Dog is a class we write).