Program to explain Generic Method in Java
Filed under: Java on 2024-04-12 18:37:56
// Program to explain Generic Method.public class GenericTest7 {// generic method printArraypublic static <T> void printArray(T[ ] inputArray) { // display array elements for (T element : inputArray) System.out.printf("%s ", element); System.out.print