Answered step by step
Verified Expert Solution
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();
}
}
- What will be placed in the blank space?
- Name the superclass and subclass.
- Which instance variables and methods are overridden in the subclass?
- What is the output?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started