What is the output of this program? (a) Error (b) Hello (c) 36 (d) Hello 36 import
Question:
What is the output of this program?
(a) Error
(b) Hello
(c) 36
(d) Hello 36
Transcribed Image Text:
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());
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 0% (1 review)
d ...View the full answer
Answered By
Muhammad Umair
I have done job as Embedded System Engineer for just four months but after it i have decided to open my own lab and to work on projects that i can launch my own product in market. I work on different softwares like Proteus, Mikroc to program Embedded Systems. My basic work is on Embedded Systems. I have skills in Autocad, Proteus, C++, C programming and i love to share these skills to other to enhance my knowledge too.
3.50+
1+ Reviews
10+ Question Solved
Related Book For
Question Posted:
Students also viewed these Computer science questions
-
You have been given the information for Knicks Inc, a publicly traded sporting team that owns 72% of Linsanity, a television network. Linsanity has been fully consolidated into Knickss financial...
-
At the end of a race a runner decelerates from a velocity of 8.00 m/s at a rate of 0.300 m/s. (a) How far does she travel in the next 14.0 s? m (b) What is her final velocity? m/s
-
An object of height 3cm is placed at 10cm from a concave lens of focal length 15cm. Find the size of the image.
-
Write a formula for a function g whose graph is similar to f(x) but satisfies the given conditions. Do not simplify the formula. f(x) = 3x 3x + 2 (a) Shifted right 2000 units and upward 70 units (b)...
-
The temperature of a Pyrex disk is changed from 10.0oC to 60.0oC. Its initial radius is 8.00 cm; its initial thickness is 0.500 cm. Take these data as being exact. What is the change in the volume of...
-
(a) Find H at (0, 0, 5) due to side 2 of the triangular loop in figure (a).(b) Find H at (0, 0, 5) due to the entire loop. 10 A (a)
-
Derive the equation of motion for free transverse vibration of a simply supported, specially orthotropic plate that is subjected to in-plane loads per unit length \(N_{x}\) and \(N_{y}\) as shown in...
-
Using the data in BE3-5, Journalize and post the entry on July 1 and the adjusting entry on December 31 for Kalter Insurance Co. Kalter uses the accounts Unearned Service Revenue and Service Revenue....
-
Can you comment to these two posts of my classmates its discussion questions and i need to comment in two of them? To me, what makes someone beautiful changes in stages. My first initial perception...
-
Given the following classes: Will the following code compile? If not, why? class Shape { /*... */ } class Circle extends Shape { /* class Rectangle extends Shape { /* class Node { /* ... */ } */ } */...
-
Will the following method compile? If not, why? public static void print (List
-
You want to buy a new ski boat 2 years from now, and you plan to save $8,200 per year, beginning one year from today. You will deposit your savings in an account that pays 6.2% interest. How much...
-
Why is Earth science an integrated science?
-
What kind of rock is most common in the oceanic crust? In the continental crust?
-
Relate the saying What goes up, must come down to the water cycle.
-
How would GPS technology have been helpful to Alfred Wegener?
-
Why do mountains rise in the mantle as they erode? What principle of Earth science explains this process?
-
Jon Tyler is a handyman who does odd jobs such as painting, fixing leaky faucets, installing ceiling fans, and minor electrical work. Jill Safford recently contracted with Jon to paint the outside of...
-
A survey of 70 college freshmen asked whether students planned to take biology, chemistry, or physics during their first year. Use the diagram to answer each question. How many of the surveyed...
-
An entry in the switching table of a virtual-circuit network is normally created during the setup phase and deleted during the teardown phase. In other words, the entries in this type of network...
-
Use the results of Problem P7-1 to infer that the bandwidth of a UTP cable decreases with an increase in distance. Problem 7-1 Using Figure 7.6, tabulate the attenuation (in dB) of a 18-gauge UTP for...
-
Use the results of Problem P7-4 to infer that the bandwidth of a coaxial cable decreases with the increase in distance. Problem P7-4 Using Figure 7.9, tabulate the attenuation (in dB) of a 2.6/9.5 mm...
-
At t=1.0 s, a person walking with constant velocity is located at x=3.0 m. At t = 6.0 s the person is located at x=5.0 m. (a) Draw a position vs. time graph for the person, and find their velocity...
-
As a demonstration of uniform circular motion in class, I often swung my keys from a 52.0 cm string in a horizontal circle over my head. Suppose my keys have a mass of 240. g, and during their motion...
-
A very small object carrying -4.0 C of charge is attracted to a large, well-anchored, positively charged object. How much kinetic energy does the negatively charged object gain if the Voltage:...
Study smarter with the SolutionInn App