-
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 Result
{
public static void main(String args[])
{
genericstackgenericstackObj0 = new genericstack ();
genericstackObj0.push("Inteview");
System.out.print(genericstackObj0.pop() + " ");
genericstackgenericstackObj1 = new genericstack ();
genericstackObj1.push("Mania");
System.out.println(genericstackObj1.pop());
}
}
-
- Mania
- Interview
- InterviewMnai
- Inerview Mania
- None of these
Correct Option: D
Inerview Mania