What is the output of this code? class A { protected int i; private int j;...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
What is the output of this code? class A { protected int i; private int j; } class B extends A{ public B(){ } super.j = super.i + 1; } private void someMethod () { System.out.println(super.i+""+ super.j); } Bb= new B(); b.someMethod (); What is the output of this code? class A { protected int i; private int j; } class B extends A{ public B(){ } super.j = super.i + 1; } private void someMethod () { System.out.println(super.i+""+ super.j); } Bb= new B(); b.someMethod ();
Expert Answer:
Answer rating: 100% (QA)
The code sample you provided is in Java It defines two classes A and B where B extends A Class A has a protected integer i and a private integer j Cla... View the full answer
Related Book For
Building Java Programs A Back To Basics Approach
ISBN: 9780135471944
5th Edition
Authors: Stuart Reges, Marty Stepp
Posted Date:
Students also viewed these programming questions
-
What is the output of this code? Explain how did you made the file and provide a pic of the out put. import java.io.File; import java.io.FileNotFoundException; import java.util.Scanner; public class...
-
(a) Explain how a limit worth may be tended to at run-time, both in a syntaxtree middle person and in collected code. What is the importance word "settled" already? [3 marks] (b) Give a model program...
-
Find the derivative of the function. y = e 2x tan 2x
-
Design the logic for a program that outputs numbers in reverse order from 25 down to 0.
-
Gold Star Rice, Ltd., of Thailand exports Thai rice throughout Asia. The company grows three varieties of riceFragrant, White, and Loonzain. (The currency in Thailand is the baht. which is denoted by...
-
Find the centroid of a rod of length L, and mass M, using the first principle.
-
As part of a study designed to compare hybrid and similarly equipped conventional vehicles, Consumer Reports tested a variety of classes of hybrid and all-gas model cars and sport utility vehicles...
-
You are the senior shift manager for an exciting club/restaurant at South Padre Island called, The Hypnotic Wave. You completed a test run of the business with the owner last quarter (February). The...
-
After the dot-com business he tried to start folded, David "Marty" Dawkins decided to pursue his boyhood dream of owning a bike factory. After several false starts, he finally got the small company...
-
for U(xy)=x 0.3 and 0.7 , differentiate the: to. Marshallian demand functions, b. indirect utility function, C. expenditure function, and d. Hicksian offset demands. my. Starting from I=100 p y =1 p...
-
Suppose on January 1 the value of the euro is at $1.17/euro, and later in March 1 the value of is at $1.03/Euro. By how much did the dollar appreciate or depreciate? Enter your response in percentage...
-
Amir has plans to gather several colleagues to establish a business institution. However, not all of his colleagues have capital in the form of money. Meanwhile, Anto is an activist in a village who...
-
respond to your classmates' posts on specialized trusts. Make sure you address a different type of trust then the one you discussed in your second post. If your second and third posts address the...
-
Type of Donut Number purchased Probability Cumulative Probability Chocolate Cream filled 2.00 Strawberry 3.00 Kale frosted 3.00 Blueberry 2.00 Cream filled surprise 8.00 18.00 Based on the above...
-
First summarize the information presented in that box (NOTE: your response should include a discussion of the pros and cons of hate-crime legislation). Discuss where you stand on the issue (i.e., do...
-
A quintuplex (2 commercial and 3 residential units) is available for sale at a asking price of $2.5 million. The properties main characteristics are (Centris 2021): Building characteristic (Centris...
-
A copper sphere of 10-mm diameter, initially at a prescribed elevated temperature T;, is quenched in a saturated (1 atm) water bath. Using the lumped capacitance method, estimate the time for the...
-
The following statement is an incorrect attempt to resize a hash table to twice its current size. Why is this code incorrect? What is the proper way to enlarge a hash table? elementData =...
-
Write a class named Hexagon whose objects represent regular hexagons (6-sided polygons). Your class should implement the Shape interface defined in this chapter.
-
Write a program that computes the spherical distance between two points on the surface of the Earth, given their latitudes and longitudes. This is a useful operation because it tells you how far...
-
The magical elevator. There is a man who lives on the top floor of a very tall building. Every day he gets the elevator down to the ground floor to leave the building to go to work. Upon returning...
-
A murderer is condemned to death. He has to choose between three rooms. The first is full of raging fires, the second is full of assassins with loaded guns, and the third is full of lions that havent...
-
A man went outside without an umbrella or a raincoat, yet did not get wet.
Study smarter with the SolutionInn App