Post date: Aug 05, 2018 7:10:42 AM
/!\ Final Practical on Thursday
Chapter 14: Generics and the ArrayList Class
14.2 Generics
Lab Ex 1 (InformIT.com):
Write a generic method to exchange the positions of two different elements in an array.
Lab Ex 2 (adapted from Programming Project 4 p. 831):
Write a generic class, MyMathClass, with a type parameter T where T is a numeric object type (e.g., Integer, Double, or any class that extends java.lang.Number). Add a method named average that takes an ArrayList of type T and returns as a double the average of the values in the ArrayList. Use the doubleValue() method in the Number class to retrieve the value of each number as a double.
Chapter 15: Linked Data Structures
15.1 Java Linked Lists