public class ArrayMinMaxDemo
1: //ArrayMinMaxDemo.java
2: //Return the maximum and minimum values in the integer and character arrays.
3:
4: public class ArrayMinMaxDemo
5: {
6: public static void main(String args[])
7: {
8: Integer intNums[] =
9: {
10: 3, 6, 2, 8, 6
11: };
12: Character chars[] =
13: {
14: 'w', 'b', 'r', 'p'
15: };
16:
17: ArrayMinMax<Integer> intObject = new ArrayMinMax<Integer>(intNums);
18: ArrayMinMax<Character> charObject = new ArrayMinMax<Character>(chars);
19:
20: System.out.println("Max value in intNums: " + intObject.max());
21: System.out.println("Min value in intNums: " + intObject.min());
22:
23: System.out.println("Max value in chars: " + charObject.max());
24: System.out.println("Min value in chars: " + charObject.min());
25: }
26: }