Question: What is the output of this program? (a) [3, 5] (b) [3, 2] (c) [3, 2, 5] (d) [3, 5, 2] import java.util. *; class

What is the output of this program? import java.util. *; class stack { public static void main(String args []) { Stack obj new Stack(); obj.push

(a) [3, 5]

(b) [3, 2]

(c) [3, 2, 5]

(d) [3, 5, 2]

import java.util. *; class stack { public static void main(String args []) { Stack obj= new Stack(); obj.push (new Integer (3)); obj.push (new Integer (2)); obj.pop(); obj.push (new Integer (5)); System.out.println (obj);

Step by Step Solution

3.45 Rating (155 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Advanced Java Programming Questions!