Print content

Report a typo

Define and implement a generic static method info that accepts a generic array and returns the content of the input array as a String .

Examples:

  • if the argument is an int array {1, 2, 3}, the method should return the String: [1, 2, 3] ;
  • if the argument is a String array {"one", "two", "three"}, the method should return the String: [one, two, three] ;
  • if an argument is an empty array, String: [] is returned.

Sample Input 1:

Integer
8 11 3 7

Sample Output 1:

[8, 11, 3, 7]
Write a program in Java 17
// do not remove imports
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import java.util.function.Function;

class ArrayUtils {
// define info method here
}
___

Create a free account to access the full topic