-
What is the output of this program?
import java.util.*;
class genericstack
{
Stackobject = 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[])
{
genericstackgenericObject = new genericstack ();
genericObject.push(50);
System.out.println(genericObject.pop());
}
}
-
- 0
- 30
- 50
- Compilation Error
- Runtime Error
Correct Option: C
50