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

  Explain a mitigating strategy for the risks

Briefly identify and describe a mitigating strategy for the risks.

  Creating the algorithm

We suppose that we are given a majority graph in order to generate agenda for managing the sequential majority kind of election.

  What is the role of the project sponsor

be sure that you briefly describe why each of the listed tasks is critical to the success of the project and how each of the listed skills helps the project manager.

  Reasons to incorporate the venturing

Explain how are corporate ventures differentiated from other projects within the large organizations and from the entrepreneurial start-ups? List some of the reasons which incorporate the venturing has had a relatively poor track record?

  Modify a purchased software package

If the project team find out that the best alternative is to modify a purchased software package, then the team has several options to consider. What are they? What mus the project team take responsibility for in each case?

  Creating the c program

Write down a program which accepts a name for example, chocolate bluberries price per pound, and number of the pounds sold in average month .

  Define four phases of an information system''s life cycle

What are the 4 phases of an information system's life cycle? The business process of building and managing information system has four phases. These phases apply to all information systems although different systems may be acquired using different..

  Questions on risc machine

Questions on RISC machine

  How would you assess quality of a computer program

we have developed quality factors that we look for in a software product to measure quality. These are usually done at the macroscopic level, but how would you assess quality of a computer program if you received an e-mail with a source listing of..

  What are the trends of data warehousing and data mining

What are the trends of data warehousing and data mining

  Separate following program into appropriate lexemes

Separate following program into appropriate lexemes

  How to designed to implement the date in a program

The class Date was built to implement the date in a program, but the method setDate and the constructor with parameters do not check whether the date is valid before storing the date in the data members.

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