Generics2786 - Java Quiz Question


What will be the output of the following program?

import java.util.*;
public class SampleDemo {
    public static void main(String args[]) {
        Sample <Integer> obj = new Sample<Integer>();
        obj.push(36);
        System.out.println(obj.pop());
    }
}
class Sample<E>
{
    Stack <E> ob = new Stack <E>();
    public void push(E obj) {
        ob.push(obj);
    }
    public E pop() {
        E obj = ob.pop();
        return obj;
    }
}


A
36
B
Some Other Output
C
Compilation Error
D
Runtime Error