Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java Programming class Coach { String branch= athletism; int experience = 0; void talk(){ System.out.println(Win); } } The Trainer class is: public class Trainer ______________

Java Programming

class Coach {

String branch= athletism;

int experience = 0;

void talk(){

System.out.println("Win");

}

}

The Trainer class is:

public class Trainer ______________ Trainer{

String team = "Barcelona";

public Trainer(){

this.branch="Football";

}

void talk(){

System.out.println("If you play good youll win");

}

Main routine:

public static void main(String args[]){

Trainer obj = new Trainer();

System.out.println(obj.branch);

System.out.println(obj.experience);

System.out.println(obj.team);

obj.talk();

}

}

  1. What will be placed in the blank space?
  2. Name the superclass and subclass.
  3. Which instance variables and methods are overridden in the subclass?
  4. What is the output?

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Genetic Databases

Authors: Martin J. Bishop

1st Edition

0121016250, 978-0121016258

More Books

Students also viewed these Databases questions

Question

=+ f. instituting laws against driving while intoxicated

Answered: 1 week ago

Question

=+ Why have these changes occurred?

Answered: 1 week ago