Question: What is the output of this program? (a) Error (b) Hello (c) 36 (d) Hello 36 import java.util.*; public class genericstack { Stack stk= new
What is the output of this program?
(a) Error
(b) Hello
(c) 36
(d) Hello 36
import java.util.*; public class genericstack { Stack stk= new Stack (); public void push (E obj) { stk.push(obj); } public E pop () { } } } class Output ( public static void main (String args []) { genericstack gs = new genericstack (); E obj = stk. pop (); return obj; } gs.push ("Hello"); System.out.print (gs.pop() + " "); genericstack gs = new genericstack (); gs.push (36); System.out.println (gs.pop());
Step by Step Solution
3.43 Rating (153 Votes )
There are 3 Steps involved in it
d ... View full answer
Get step-by-step solutions from verified subject matter experts
