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: 100% (QA)
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...
-
Why are deposit insurance and other types of government safety nets important to the health of the economy?
-
An often-ignored concept in breach of contract is the availability, if any, of the award of punitive damages. Often, cases incorporate both breach of contract and tort actions. The tort actions...
-
On June 10, Tuzun Company purchased $8,000 of merchandise from Epps Company, FOB shipping point, terms 2/10, n/30. Tuzun pays the freight costs of $400 on June 11. Damaged goods totaling $300 are...
-
1. Two-point boundary value problem with Dirichlet condition. Consider the following second order elliptic boundary value problem in the one-dimensional space: - -u" (x) = 2, x = (0, 1), u(0) = 0,...
-
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
-
(Various Time Value Situations) Answer each of these unrelated questions. (a) On January 1, 2003, Rather Corporation sold a building that cost $250,000 and that had accumulated depreciation of...
-
How does the rehabilitation credit differ from the investment credit?
-
How does an investment credit affect the basis of an item purchased?
-
Jackson Jumper has owned a beach house for the last 20 years. In 2019, a hurricane destroyed his beach house and the beach was determined to be a federally declared disaster area. His adjusted basis...
-
What happens to the basis of an asset that has a recapture of an investment credit?
-
In 2019, Sally Morris, a single taxpayer, pays $3,000 of interest on qualified student loans. Her AGI is $40,000. What is her qualified student loan interest deduction in 2019?
-
List the legal forms and modes of transportation. Which mode is the least expensive? Which mode carries the most freight? Which mode is growing the fastest? Shrinking the fastest?
-
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...
-
A glass tube of radius 0.80 cm contains liquid mercury to a depth of 64.0 cm at 12C. Find the depth of the mercury column at 100C. Assume that the linear expansion coefficient of the glass is 10x106...
-
1. A simple device that is used to test the strength of antifreeze in cars consists of a small tube that has several small, coloured spheres inside it. When antifreeze is admitted into the tube, some...
-
A cantilever beam's end rests on the middle of a simply supported beam, as shown in the figure below. Both beams have length L and bending rigidity EI. Determine the deflection at A and the reactions...
Study smarter with the SolutionInn App