Generics in Methods and Constructors - Java Quiz Question


What will be the output of the following program?

public class GenericsMethodDemo {
    public static <E> void printArray(E[] elements) {  
        for ( E element : elements){          
            System.out.print(element +" ");
        }  
    }  
  
    public static void main( String args[] ) {  
        Character[] charArray = { 'M', 'E', 'R', 'I', 'T','C','A','M','P','U', 'S'};  
        printArray( charArray );  
    }  
}


A
M E R I T C A M P U S
B
Some other output
C
Compilation Error
D
Runtime Error