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
Before taking off a plane travels at a speed of 1/4 km per second. The runaway is 5 km. How many seconds does it take the plane
Vikentia [17]

Answer:

1 5segundos

Explanation:

8 0
3 years ago
A 1 turn coil carries has a radius of 9.8 cm and a magnetic moment of 6.2 X 10 -2 Am 2. What is the current through the coil?
Alexus [3.1K]

Answer:

The current through the coil is 2.05 A

Explanation:

Given;

number of turns of the coil, N = 1

radius of the coil, r = 9.8 cm = 0.098 m

magnetic moment of the coil, P = 6.2 x 10⁻² A m²

The magnetic moment is given by;

P = IA

Where;

I is the current through the coil

A is area of the coil = πr² = π(0.098)² = 0.03018 m²

The current through the coil is given by;

I = P / A

I = (6.2 x 10⁻² ) / (0.03018)

I = 2.05 A

Therefore, the current through the coil is 2.05 A

6 0
4 years ago
A 3-phase , 1MVA, 13.8kV/4160V, 60 Hz, transformer with Y-Delta winding connection is supplying a3-phase, 0.75 p.u. load on the
Tanya [424]

Answer:

a) 23.89 < -25.84 Ω

b) 31.38 < 25.84 A

c) 0.9323 leading

Explanation:

A) Calculate the load Impedance

current on load side = 0.75 p.u

power factor angle = 25.84

I_{load} = 0.75 < 25.84°

attached below is the remaining part of the solution

<u>B) Find the input current on the primary side in real units </u>

load current in primary = 31.38 < 25.84 A

<u>C) find the input power factor </u>

power factor = 0.9323 leading

<em></em>

<em>attached below is the detailed solution </em>

8 0
3 years ago
What is this thing on my boat?
MaRussiya [10]
It may be an engine cooler, or it may be for the boats speed

But I think it is for cooling the engine down
5 0
3 years ago
In order to test the reverse route back towards the original host, which of the following will you use? A Standard ping B Extend
Vlad1618 [11]

The function that you will use in order to test the reverse route back toward the original host is known as Extended ping. Thus, the correct option for this question is B.

<h3>What is Ping and traceroute for?</h3>

Ping and traceroute are the common commands you can effectively utilize in order to troubleshoot network problems. Ping is a simple command that can typically test the reachability of a device on the network. While traceroute is a command you use to 'trace' the route that a packet takes when traveling to its destination.

Extended ping permits a router's ping command to use The router's LAN IP address from within the subnet, fully testing the route back to the subnet. A standard ping often does not test the reverse route that you need to back toward the original host.

Therefore, the function that you will use in order to test the reverse route back toward the original host is known as Extended ping. Thus, the correct option for this question is B.

To learn more about Ping and traceroute, refer to the link:

brainly.com/question/28333920

#SPJ1

6 0
1 year ago
Other questions:
  • A rigid tank with a volume of 4 m^3 contains argon at 500 kPa and 30 deg C. It is connected to a piston cylinder (initially empt
    14·1 answer
  • The head difference between the inlet and outlet of a 1km long pipe discharging 0.1 m^3/s of water is 0.53 m. If the diameter is
    11·1 answer
  • A tensile test is performed on a metal specimen, and it is found that a true plastic strain of 0.20 is produced when a true stre
    14·2 answers
  • 12. The small space above the piston in which fuel is burned is called the
    10·1 answer
  • Part A - Transmitted power A solid circular rod is used to transmit power from a motor to a machine. The diameter of the rod is
    8·1 answer
  • An electric power plant uses solid waste for fuel in the production of electricity. The cost Y in dollars per hour to produce el
    10·1 answer
  • 6.
    8·1 answer
  • A Wii remote flung from a hand through a TV, with a kinetic energy of 1.44J and a mass of 4.5kg. Whats the velocity?
    6·1 answer
  • The Accenture team is involved in helping a client in the transformation journey using Cloud computing. How is myNav beneficial
    6·1 answer
  • You are coming to this intersection, and are planning on turningright. There is a vehicle close behind you. You should?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!