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

  Why valuable time is lost in planning

Valuable time is lost in planning. Substantial savings could be realized if corporations would cut down on planning and concentrate on implementing.

  Describe the program development cycle

Describe the importance of using a structured, modular approach when creating program requirements, design, and code.

  Quantifying the software development

This organization is interested in quantifying its software development. Write down a report proposing suitalbe metrics and propose how these can be collected.

  Design a system for the organization of the choice

Design a system for the organization of your choice. This could be for the current or former employer or some fictitious organization. The system you plan might be data storage, telecommunications, e-commerce, accounting information, manufacturing ..

  Handling of global ethics issue by organizations

Our textbook describes the ethics as “the principles of right and wrong which individuals utilize in order to make choices in order to guide their behaviors”.One global ethical issue is software piracy. What can the organizations such as Microsoft ..

  Program dealing with selection of five random cards

Generate a program which deals with the five random cards.

  Creating a program with a building as subclass

Assume the existence of the Building class. Describe a subclass, ApartmentBuilding that consists of following instance variables: an integer, a boolean, numFloors, an integer, hasElevator, unitsPerFloor, a boolean, hasCentralAir, and a string, man..

  The application must calculate the average

make a Java Application that will ask the user for his or her name and to enter in three numbers. The application should calculate the average and then output the value to the user.

  Authenticating the evidence

You will offer the POC additionally as a matter of procedure the known facts of incident and what are the procedures were utilized during the initial case reviews. Identification of any collection requirements for attaining and authenticating the ..

  Define why it is suggested that for security reasons

Since many commercial APs have the SSID broadcast option enabled by default, so clients may easily detect the presence of an AP. APs are also configured as DHCPs and Firewalls.

  Find minimal cover and identify all possible candidate keys

Find minimal cover and identify all possible candidate keys - Functional Dependencies

  What are the implications for management

Reduction in cost of hardware with time.What are the implications for management of each of the trends.

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