1.

What is the output of this program?
import java.util.*;
class genericstack
{
Stack object = new Stack ();
public void push(E obj)
{
object.push(obj);
}
public E pop()
{
E obj = object.pop();
return obj;
}
}

public class Output
{
public static void main(String args[])
{
genericstack genericObject = new genericstack();
genericObject.push(50);
System.out.println(genericObject.pop());
}
}

A. 0
B. 30
C. 50
D. Compilation Error
E. Runtime Error
Answer» D. Compilation Error


Discussion

No Comment Found

Related MCQs