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
Alicia uses a software application to store the names, email addresses, and phone numbers of her friends in alphabetical order. 
SpyIntel [72]

I think she's using Excel.

6 0
3 years ago
What are the five types of docs you can create an share with google docs
Mademuasel [1]

Answer:

Documents: For composing letters, flyers, essays, and other text-based files (similar to Microsoft Word documents)

google sheets logo Spreadsheets: For storing and organizing information (similar to Microsoft Excel workbooks)

google slides logo Presentations: For creating slideshows (similar to Microsoft PowerPoint presentations)

google forms logo Forms: For collecting and organizing data

google drawings logo Drawings: For creating simple vector graphics or diagrams

Explanation:

8 0
3 years ago
Read 2 more answers
During which part of geologic time did photosynthesis evolve?
m_a_m_a [10]
During Archean part of geological time photosynthesis evolve.
8 0
3 years ago
Read 2 more answers
Fungsi radio adalah..?
malfutka [58]

Answer:

lebih lanjut bahwa radio mempunyai fungsi sebagaimana media- media lain yaitu memberikan informasi/to inform, memberikan pendidikan/to educate, memberikan hiburan/to intertain, fungsi memengaruhi/to influence, dan fungsi pengawasan to control.

<h2>translate;</h2>

Furthermore, radio has a function like other media, namely to provide information/to inform, provide education/to educate, provide entertainment/to intertain, function to influence/to influence, and control function to contact.

Explanation:

8 0
2 years ago
What standards organization maintains the ethernet standard?.
Fofino [41]

Answer:

Ethernet standards are written and maintained by the IEEE, the Institute of Electrical and Electronic Engineers which has its corporate office in New York City and its operations center in Piscataway, New Jersey.

Explanation:

5 0
2 years ago
Other questions:
  • Ascending and descending are examples of
    5·2 answers
  • When was unicode invented?
    13·1 answer
  • Let C(x) be the statement "x has a cat," let D(x) be the statement "x has a dog," and let F(x) be the statement "x has a ferret.
    12·1 answer
  • Contextual targeting method mean
    11·1 answer
  • Write an algorithm to determine a students final grade and indicate whether it is passing or failing .the final grade is calcula
    12·1 answer
  • The browser on which you are viewing web pages is called the
    13·1 answer
  • 10.7 LAB: Fat-burning heart rate Write a program that calculates an adult's fat-burning heart rate, which is 70% of 220 minus th
    8·1 answer
  • What software maintain and increase the efficiency of a computer system?
    12·1 answer
  • 2 what is deep learning?
    5·1 answer
  • failed logins or instances of denial of access to restricted files may be indicators of compromise. suggest where records of suc
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!