The GDK extensions go beyond the Object class. Several other JDK classes and interfaces have been enhanced in the GDK. Again, the list is vast and we’ll look at only a subset of extensions in this section. These are the extensions we’re likely to put to regular use.
We can use the Range object as an index on all the array types (for the syntax for creating arrays, see Different Syntax for Creating Primitive Arrays), such as int, double, and char. Here’s how we can access contiguous values in an int array using the range of index:
int arr = [1, 2, 3, 4, 5, 6]
The output shows the values in the given range:
[3, 4, 5]
We’re already familiar with a ...