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 genericObj = new genericstack(); genericObj.push("Interview"); System.out.println(genericObj.pop()); } }

A. Interview
B. InterviewMania
C. Interviw Mania
D. Compilation Error
E. Runtime Error
Answer» B. InterviewMania


Discussion

No Comment Found

Related MCQs