@@ -0,0 +1,764 @@
+// from https://www.hackerrank.com/challenges/30-generics%0A%0A// Write a single generic function named printArray;%0A// this function must take an array of generic elements as a parameter.%0A%0Aimport java.lang.reflect.Method;%0A%0Aclass Solution %7B%0A  %0A  public static %3CE%3E void printArray(E%5B%5D genericArray) %7B%0A    for (int i = 0; i %3C genericArray.length; i++) %7B%0A      E element = genericArray%5Bi%5D;%0A      System.out.println(element);%0A    %7D%0A  %7D%0A%0A  public static void main(String args%5B%5D)%7B%0A    Integer%5B%5D intArray = %7B 1, 2, 3 %7D;%0A    String%5B%5D stringArray = %7B %22Hello%22, %22World%22 %7D;%0A%0A    printArray( intArray  );%0A    printArray( stringArray );%0A%0A    if(Solution.class.getDeclaredMethods().length %3E 2)%7B%0A      System.out.println(%22You should only have 1 method named printArray.%22);%0A    %7D%0A  %7D%0A%7D%0A

Add generic function solution to daily_problems