My issue
Wrong Answer: Failed on a hidden test case even i write correct code it shows like this
My code
class Codechef {
// Generic method with one type parameter
public static < T > void printValue(T value) {
System.out.println("Value:" + value);
}
// Overloaded generic method with a different type parameter
public static < T, U > void printValues(T value1, U value2) {
System.out.println("Value 1:" + value1);
System.out.println("Value 2:" + value2);
}
// Overloaded generic method with different parameter types
public static < T > void printArray(T[] array) {
for (T element: array) {
System.out.print(element+" ");
}
System.out.println();
}
public static void main(String[] args) {
// Calling the first generic method with an Integer
Codechef.printValue(42);
// Calling the second generic method with an Integer and a String
Codechef.printValues(42, "Hello");
// Calling the third generic method with an Integer array
Integer[] intArray = {1,2,3,4,5};
Codechef.printArray(intArray);
}
}
Learning course: Advanced Java programming
Problem Link: https://www.codechef.com/learn/course/alvas-advanced-java/ALAJA17/problems/OPJA218