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
What is the radix transformation method?
alex41 [277]
A method of transformation that involves changing the radix or base of the original key and either discarding excess high-order digits (that is, digits in excess of the number desired in the key) or extracting some part of the transformed number.
4 0
3 years ago
Which of the following is the best example of market censorship
Papessa [141]
To bleep it out! hopefully this helped
4 0
3 years ago
Read 2 more answers
HELP ME ASAP PLS BEING TIMED
kkurt [141]

Answer:

It would be considered cheating.

Explanation:

Any type of electronic use is considered cheating because you can look up the answers on the same phone or text someone for the answer. And so, Text messaging during a test is cheating because of the fact that is convenient to the cheater and not convenient to the teacher that is grading.

8 0
3 years ago
Read 2 more answers
Which of the following is NOT an example of editing?
Genrish500 [490]

Answer:

ang answer po at proofreading written

content

Explanation:

if I wrong please correction me!

8 0
2 years ago
Which of the following is a sign that a website is inappropriate?
nata0808 [166]

Answer:

A

Explanation:

If you find something embarrassing, its more likely that other people with also think its embarrassing. All the other points are on the internet right now. Amazon sells things, News show information and there are political campaigns to show you there offers

3 0
3 years ago
Read 2 more answers
Other questions:
  • A web page created expressly in hopes of ranking well for a term in a search engine's organic/non-paid listings and which itself
    7·1 answer
  • When an IRET instruction isexecuted, what action takes place?
    13·1 answer
  • Katarina is deciding whether to buy a desktop or a laptop computer. What will most likely help Katarina make her decision?
    10·2 answers
  • Write a program in C++ or C that includes two different enumeration types and has a significant number of operations using the e
    15·1 answer
  • If you have configured your prompt so that it does not show your working directory, you can use the ____ command to verify in wh
    15·1 answer
  • Suppose the fixed width of an aside element in a fixed layout is 300 pixels, and the fixed width of its parent element (body) is
    15·1 answer
  • Write an HTML document which contains two text fields, a button, and a div. The first text field should be labeled “Temperature”
    10·1 answer
  • Which browser should you choose if you want all viewing information except thumbnail previews of websites?
    15·2 answers
  • According to the stage-gate process developed by Robert G. Cooper, _____ are the results of the previous stage and are the input
    15·1 answer
  • Which programming element is used by a game program to track and display score information?
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!