1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Mazyrski [523]
3 years ago
15

Write 3 classes with three levels of hierarchy: Base, Derive (child of base), and D1 (child of Derive class). Within each class,

create a "no-arg" method with the same signature (for example void m1( ) ). Each of this method (void m1( ) ) displays the origin of the Class type. Write the TestDynamicBinding Class: (the one with the ‘psvm’ ( public static void main (String[] args)) to display the following. You are NOT allowed to use the "standard object.m1() "to display the message in the main(…) method. That would NOT be polymorphic! (minus 10 points for not using polymorphic method) Explain why your solution demonstrates the dynamic binding behavior
Engineering
1 answer:
PIT_PIT [208]3 years ago
6 0

Answer:

class Base

{

void m1()

{

System.out.println("Origin: Base Class");

}

}

class Derive extends Base

{

void m1()

{

System.out.println("Origin: Derived Class");

}

}

class D1 extends Derive

{

void m1()

{

System.out.println("Origin: D1 - Child of Derive Class");

}

}

class TestDynamicBinding

{

public static void main(String args[])

{

Base base = new Base(); // object of Base class

Derive derive = new Derive(); // object of Derive class

D1 d1 = new D1(); // object of D1 class

 

Base reference; // Reference of type Base

reference = base; // reference referring to the object of Base class

reference.m1();   //call made to Base Class m1 method

 

reference = derive;   // reference referring to the object of Derive class

reference.m1(); //call made to Derive Class m1 method

 

reference = d1;    // reference referring to the object of D1 class

reference.m1(); //call made to D1 Class m1 method

}

}

Explanation:

The solution demonstrates dynamic binding behavior because the linking procedure used calls overwritten method m1() is made at run time rather than doing it at the compile time. The code to be executed for this specific procedural call is also known at run time only.

You might be interested in
Heating of Oil by Air. A flow of 2200 lbm/h of hydrocarbon oil at 100°F enters a heat exchanger, where it is heated to 150°F by
irakobra [83]

Answer:

2062 lbm/h

Explanation:

The air will lose heat and the oil will gain heat.

These heats will be equal in magnitude.

qo = -qa

They will be of different signs because one is entering iits system and the other is exiting.

The heat exchanged by oil is:

qo = Gp * Cpo * (tof - toi)

The heat exchanged by air is:

qa = Ga * Cpa * (taf - tai)

The specific heat capacity of air at constant pressure is:

Cpa = 0.24 BTU/(lbm*F)

Therefore:

Gp * Cpo * (tof - toi) = Ga * Cpa * (taf - tai)

Ga = (Gp * Cpo * (tof - toi)) / (Cpa * (taf - tai))

Ga = (2200 * 0.45 * (150 - 100)) / (0.24 * (300 - 200)) = 2062 lbm/h

5 0
3 years ago
Answer true or false 3.Individual people decide what will be produced in a command<br> oconomy
Pie

Answer:

False

Explanation:

The government decides the productions.

7 0
3 years ago
Read 2 more answers
What is the shape of the output signal on a rigexpert analyzer?
Gekata [30.6K]

Answer:

Output signal shape: square, from 0.1 to 230 MHz. Output power: -10 dBm (at a load of 50 Ohms).

Explanation:

8 0
2 years ago
Read 2 more answers
cThe Mars Rover Spirit got stuck in the Martian sand. The wheels kept slipping. Attempts to free it were futile. Discuss the typ
IgorC [24]

Answer:

Improved/ advanced types of Actuators include servo systems, create a large range of actuator motion in response to the changing needs of the operational environment or process.

Actuators are local or automated suppliers of working motion.

Hydraulic and air cylinders can be classified as single-acting cylinders, meaning that the energy source result in movement in one direction and a spring is used for the other direction.

Explanation:

An actuator control system is referred to as any electronic, electrical, or electromechanical system often used to activate an actuator, control the direction as well as extent and duration of its output. Actuator control systems could take the form of extremely simple, manually-operated, start-and-stop stations, either sophisticated or programmable computer systems. The more improved/ advanced types include servo systems that produce a large range of actuator motion in response to the changing needs of the operational environment or process. This type of actuator control system uses an interface arrangement that assimilates feedback from the process or mechanism and adjusts the actuator in the right way. Most actuator systems will include at least a set of travel limits that prevent the actuator destroying itself or the secondary mechanism.

Actuators are local or automated suppliers of working motion. They are used to changes, adjust, or move a secondary mechanism, where a physical operator cannot intervene directly. They are denoted by a large range of varying types using electrical and electromagnetic, hydraulic, or pneumatic power sources to create linear or rotary outputs. One element they all have in common is the actuator control system used to start, stop, and adjust the range, speed, and duration of the working motion.

Actuators can produce a linear motion, rotary motion or oscillatory motion which means they can create motion in one direction, in a circular motion or in opposite directions at regular intervals. Hydraulic and air cylinders can be classified as single-acting cylinders, meaning that the energy source result in movement in one direction and a spring is used for the other direction.

7 0
3 years ago
Water at 200C flows through a pipe of 10 mm diameter pipe at 1 m/s. Is the flow Turbulent ? a. Yes b. No
Degger [83]

Answer:

Yes, the flow is turbulent.

Explanation:

Reynolds number gives the nature of flow. If he Reynolds number is less than 2000 then the flow is laminar else turbulent.

Given:

Diameter of pipe is 10mm.

Velocity of the pipe is 1m/s.

Temperature of water is 200°C.

The kinematic viscosity at temperature 200°C is 1.557\times10^{-7}m2/s.

Calculation:

Step1

Expression for Reynolds number is given as follows:

Re=\frac{vd}{\nu}

Here, v is velocity, \nu is kinematic viscosity, d is diameter and Re is Reynolds number.

Substitute the values in the above equation as follows:

Re=\frac{vd}{\nu}

Re=\frac{1\times(10mm)(\frac{1m}{1000mm})}{1.557\times10^{-7}}

Re=64226.07579

Thus, the Reynolds number is 64226.07579. This is greater than 2000.

Hence, the given flow is turbulent flow.

5 0
2 years ago
Other questions:
  • Are engineers needed in today’s society ? Why or why not ? I need a short three paragraph essay !!! Please help me !!!
    13·1 answer
  • A evolução da malha rodoviária do Brasil é um marco notável
    9·1 answer
  • Material with hardness of 220 Vickers is harder than material with a hardness of 180 Vickers. a)-True b)- False
    8·1 answer
  • What is the main role of matrix in composites! a)-to transfer stress to the other phases b)- to protect phases from environment
    7·1 answer
  • Consider a voltage v = Vdc + vac where Vdc = a constant and the average value of vac = 0. Apply the integral definition of RMS t
    7·1 answer
  • You are preparing to work with Chemical A. You open the appropriate storage cabinet, and notice Chemical B, as well as Chemical
    9·1 answer
  • The average human heart Beats 1.15 times 10 to the power of 5 per day. There are 3.65 times 10 to the power of 2 days in one yea
    14·1 answer
  • Can you screen record on WOW Presents Plus on iPhone?
    12·1 answer
  • A jackhammer uses pressurize gas to change it forced to the hammer what type of mechanical system is it a jackhammer it uses in
    5·1 answer
  • An ideal gas is contained in a closed assembly with an initial pressure and temperature of
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!