Write a generic method reverseArray that reverses the order of elements in an array. Use this generic

Question:

Write a generic method reverseArray that reverses the order of elements in an array. Use this generic method in a program to reverse arrays of different types.

Print each array both before and after calling reverseArray using a generic method similar to Fig. 20.3.

Fig. 20.3

1 // Fig. 20.3: GenericMethodTest.java 2 // Printing array elements using generic method printArray. 1234 3 4

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question

Java How To Program Late Objects Version

ISBN: 9780136123712

8th Edition

Authors: Paul Deitel, Deitel & Associates

Question Posted: