Give an the output of program

Assignment Help Computer Engineering
Reference no: EM1330978

What is the output of this Java program?

public class InheritanceProblem
{
public static void main(String[] args)
{
System.out.println(new X().message());
System.out.println(new Y().message());
System.out.println(new Z().message());
}
}
class X
{
String size, color;
X() { this("BIG","RED"); }
X(String s, String c) { size = s; color = c; }
public String message() { return "I am " + description() + "."; }
protected String description() { return size + " and " + color; }
}
class Y extends X
{
Y() { super("SMALL","RED"); }
public String message() {return "I wish I were " + description() + ".";}
}
class Z extends X
{
Z() { super("BIG","BLUE"); }
protected String description() { return size + " but not " + color; }
}

Reference no: EM1330978

Questions Cloud

Working in a diverse organization : Explain benefits of working in a diverse organization.
Make sure to comprise a history of the company or industry : Make sure to comprise a history of the company or industry or the market in which it operates.
Show the relationship between budgeting and planning : Show the relationship between budgeting and planning and How are they related? What differences exist between the two?
Comparing and contrasting leadership theories : Compare and contrast leadership theories that you believe would be most influential and beneficial to an organization's management practices in order to lead change in that organization.
Give an the output of program : What is an output of this Java program.
Law for management of hospital : You are the Manager/CEO of a small rural hospital and you have a definitive management style (your style).
Measurement scales and questions : Measurement scales and questions to elicit consumer response
Relationship between bond price and interest rates : What is the relationship between the price of the bond and interest rates? Why does the price of bond change over its lifetime?
Demand analysis whereas impact of government regulations. : describing market trends with disney theme parks also supply and demand analysis whereas impact of government regulations.

Reviews

Write a Review

Computer Engineering Questions & Answers

  What is essential address field width

What is essential address field width

  Troubleshooting the infected system

AV software has eliminated the malware from a highly infected system. After first reboot, an error message is displayed which consists of a reference to the strange DLL file which is missing.

  Create a program to read this list of prices

Wrtie down a program to read this list of prices and the sales table and calculate total dollar sales for each salesperson and the total dollar sales for all salespersons.

  How to classify emerging technologies

How to classify emerging technologies Inscribe obviously and succinctly about information management systems using proper writing mechanics.

  Providing the justification

Joe the janitor is recorded in the company security camera one night taking the pictures with his cell phone of office of CEO after he is done with cleaning. What will you do and provide justification for your actions?

  How to illustrate a memory map for a system

Illustrate a memory map for a system with a memory capability of 512MB. Each memory location in system is 8 bits.

  How to create the clients by service rep report

How to create the clients by service rep report create mailing label for client table

  Requirements for telecommunications planning

Discuss what do you understand by the general estimate requirements for the enterprise telecommunications planning and also explain in detail the cable estimating procedures.

  Suspecting the icmp flooding attack

In reviewing your firewall logs, you notice a large number of the ICMP echo requests coming from external host 63.10.100.4. You suspect an attempted ICMP flooding attack. How could you respond.

  Circumventing the license check

Assume the "license" is just a digitally signed file listing a hostname and expiration date; the verification key is built into the executable. How would you go about circumventing this kind of license check?

  What are disadvantages of low class

What are disadvantages of low class What are advantages of high value?

  Determining dimension of polyhydron

Determine the dimension of P. Find the inequalities which describe each extreme point of P.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd