diff --git a/GenericMethod1.java b/GenericMethod1.java new file mode 100644 index 0000000..0277712 --- /dev/null +++ b/GenericMethod1.java @@ -0,0 +1,17 @@ +// 8B +public class GenericMethod1{ + public static void main(String arg[]){ + Integer[] intArray = {1, 2, 3, 4, 5}; + String[] stringArray = {"Hello", "World", "!"}; + System.out.println("Integer Array: "); + printArray(intArray); + System.out.println("String Array: "); + printArray(stringArray); + } + public static void printArray(T[] arr){ + for(T element: arr){ + System.out.print(element + " "); + } + System.out.println(); + } +} diff --git a/Screenshots/program8B.png b/Screenshots/program8B.png new file mode 100644 index 0000000..5450417 Binary files /dev/null and b/Screenshots/program8B.png differ