Generics Consturctor - Java Quiz Question


Is program compiles or not?

public class GenericsType<MC> {
    private MC t;
    public MC get() {
        return this.t;
    }
    public void set(MC t1) {
        this.t = t1;
    }
    public static void main(String args[]) {
        GenericsType<String> type = new GenericsType<String>();
        type.set("Merit");
        GenericsType type1 = new GenericsType(); // LINE A
        type1.set("Campus");
        type1.set(10); // LINE B
    }
}


A
Program compile successfully.
B
Compilation Error because - Generic is not there at LINE A.
C
Compilation Error because at LINE B trying to insert value 10.
D
Compilation Error or Runtime Error for some other reason.