June 2017
Beginner
1296 pages
69h 23m
English
20.3 (Explain Notation) Explain the use of the following notation in a Java program:
public class Array<T> { }
20.4 (Generic Method selectionSort) Write a generic method selectionSort based on the sort program of Fig.19.4 . Write a test program that inputs, sorts and outputs an Integer array and a Float array. [Hint: Use <T extends Comparable<T>> in the type-parameter section for method selectionSort, so that you can use method compareTo to compare the objects of the type that T represents.]
20.5 (Overloaded Generic Method printArray) Overload generic method printArray of Fig.20.3 so that it takes two additional integer arguments, lowSubscript and highSubscript. A call to this method prints only the designated portion of the array. ...
Read now
Unlock full access