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
Reika [66]
3 years ago
14

Create a class called Jack that extends Leo. This class must have the following behaviors/methods. You must use the inheritance

to reuse the methods from the parent classes. Solution without using the inheritance will get zero points. re-writting the code that already exists will get zero credit. A call to the methods in the parent classes must be donemethod description
method1 display "Jack 1 Leo 1 "
method2 displays "Don 2 Jack 2"
method3 displays "Jack 3 Leo 3 Don 2 "
toString displays" Jack 3 Leo 1"
Computers and Technology
1 answer:
lara [203]3 years ago
8 0

Answer:

public class Leo{

public String method1(){

return "Jack 1 Leo 1";

}

public String method2(){

return "Don 2 Jack 2";

}

public String method3(){

return "Jack 3 Leo 3 Don 2";

}

public String toString(){

return "Jack 3 Leo 1"

}

}

public class Jack extends Leo{

}

Explanation:

Leo is the parent class and jack inherits all of its attributes from Leo

So when you call the following code in the main method:

Jack j = new Jack();

System.out.println(j.method1);

it should print Jack 1 Leo 1

This is because the program first checks if method 1 exists in the Jack class

Because it doesn't exist it then goes to the parent class which is Leo.

And in the Leo class method1 displays "Jack 1 Leo 1 "

So it prints that

You might be interested in
Choose all items that represent essential features of excellent navigation menu design.
balandron [24]

Answer:

A,B,D,E

Explanation:

4 0
3 years ago
Read 2 more answers
Lol WAKE UP!!! and get ready to answer my questions.
deff fn [24]

Answer:

<h2>1. Variable Creation Statement</h2><h2>2. Fav_Num=7</h2>

Explanation:

<h2><em>Hope This Helps :)</em></h2><h2>Im not sure if the 2nd one is correct but i think that it is.</h2>
5 0
3 years ago
The level of competition is an important factor for many people when selecting a physical activity.
Art [367]

Answer:

Its false

Explanation:

And this is because, the level of competition will matter when you are doing the mental activity, and in general when you are doing the physical activity then the level of competition never matters. And note that you are doing an activity which is always of one level in case of physical activity, and no sort of games where the competition does matter, and you need to beat the record all the time. You are in this situation challenged physically though always at one level which is fixed and known in advance, and how much exertion your body can withstand, and that is a competition in itself. However, no other competition or level is a factor in this scenario. Though in case of mental activity the requirement can vary at times, and hence requiring the varied level of competition.

6 0
3 years ago
Read 2 more answers
In popular usage and in the media, the term ________ often describes someone who breaks into a computer system without authoriza
ch4aika [34]
The answer here is hacker
6 0
3 years ago
The _____________ loop allows the receiver to communicate with the sender in the imc process.
postnew [5]
Feedbacks
perhaps !!
<span>The feedback loop allows the receiver to communicate with the sender in the imc process.</span>
4 0
3 years ago
Other questions:
  • Who invented the first RAM stick
    11·1 answer
  • The Earth's _______ is ductile overall, tending to flow very slowly and deform in a _______ manner.
    14·2 answers
  • Given the lists list1 and list2 that are of the same length, create a new list consisting of the last element of list1 followed
    13·1 answer
  • In terms of online safety, what is the grooming process, (predators).
    5·2 answers
  • The purpose of the align phase is to align your team with ______.
    9·1 answer
  • Andrew works for a company that develops for a company that develops optic-fiber cables for transmission of data. which layer of
    14·1 answer
  • What is an example of value created through the use of Deep Learning?​
    12·2 answers
  • Nicole is in a study group to prepare for a test on plant biology, a subject she knows a lot about. During their meetings, she a
    12·2 answers
  • PLEASE HELP WITH KHAN ACADEMY WILL GIVE BRAINLIEST!!!!!!!!!!!!!!!!!!!!!!!!
    12·1 answer
  • A related database stores data in the form of______
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!