Generic Interfaces2770 - Java Quiz Question


What will be the output of the following program?

public class BoxDemo {
    public static void main(String[] args) {  
        Box a = new Box();  
        a.add(10);  
        System.out.print(a.get());  
    }  
}
interface a<T>{  
    public void add(T t);  
}  
class Box implements a<Integer> {  
    int t;  
    public void add(Integer t) {  
        this.t = t;  
    }  
     public int get() {  
        return t;  
     }  
}


A
10
B
0
C
Compilation Error
D
Runtime Error