Question: 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!