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]
2 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]2 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
.- Una tienda de vestidos de fiesta, ofrece un descuento a las personas
elena55 [62]

ajaaaieisslslqlqlqqpqlkek3k2l2ll2llllww

4 0
3 years ago
For which input values will the following loop not correctly compute the maximum of the values? 1. Scanner in = new Scanner (Sys
My name is Ann [436]

Answer:

The answer is "Option d".

Explanation:

Please find the complete question in the attached file.

8 0
3 years ago
Today when Dylan turned on his computer, he noticed that the monitor was very dim. He could still see the desktop icon and text.
Vadim26 [7]

Answer:

B. Monitor backlighting

Explanation:

The computer system is a machine that can digitally receive input, process the inputted data and display and save results. The computer system is a physical system driven by a software component.

The computer hardware components are classified as input unit or devices, output unit, memory and storage unit, and  processing unit. The screen is an output unit of the computer system, it displays the output or result of the processed data.

The power supply to the screen, in this context, is not faulty due to the other screen used in testing the supply and input connectors. The back light on the screen has failed and that is why the brightness can not be adjusted.

3 0
3 years ago
A python programmer is writing a function definition. What syntax should be used?
Kay [80]

Answer:

<u>Syntax of function in the Python Programming Language.</u>

def function_name():

   '''body of the function or code'''

#calling of the function

function_name()

Note: In Python Programming Language, Indentation is sensitive if you not focus on the indentation then, you program occurs an indentation error.

Explanation:

In Python Programming language, we can use the "def" keyword to define a function then we write the name of the function and then use parentheses for the argument list. "#" is used for the single-line comment and " ''' ''' " is used for the multiple line comment.

A function is the part or module of the program which provides users the feature of reusability of that code anywhere only by calling them.

8 0
3 years ago
The application layer in the tcp/ip protocol suite is usually considered to be the combination of ________ layers in the osi mod
navik [9.2K]
Application Presentation and Session Layers.
8 0
3 years ago
Other questions:
  • Write a program that asks the user to enter a number within the range of 1 through 10. Use a switch statement to display the Rom
    13·1 answer
  • What should you do before cleaning the top of a storage battery and rinsing it with fresh water?
    12·1 answer
  • What do the groups in professional networking sites allow you to do?
    10·1 answer
  • An IT security threat is anything that might cause serious harm to a computer system, including someone stealing a laptop that c
    8·2 answers
  • Describe the functions of a system software​
    6·2 answers
  • No down payment, 18 percent / year, payment of $50/month, payment goes first to interest, balance to principal. Write a program
    9·1 answer
  • HELLLLLLLLPPPPPPPPPPPP HHHHHHHHHEEEEEEEEELLLLLLPPPPPP MEEEEEEEE
    12·2 answers
  • .NET
    15·1 answer
  • Phân tích 5 phương hướng nhiệm vụ phát triển nông -lâm -ngư nghiệp ở nước ta hiện nay
    11·1 answer
  • Question 12 (5 points)
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!