Question: Terminology A method with a body is a concrete method. It can be called by the object. A method with only the signature defined but
Terminology
A method with a body is a concrete method. It can be called by the object.
A method with only the signature defined but no body. The method is called an abstract method. The class with a mix of concrete and abstract methods is called abstract class. We cannot create an object from an abstract class because of the missing body.
If you don't understand the above terminology, I encourage you to study a tutorial on abstract keyword in javaGeeksforGeeks.
Sample program
You are given Java source files: Car, MustangGT, Model and TestTrack.
The Car class has a concrete pressGasPedal method and an abstract brake method.
Model is an electric car that can accelerate and brake faster than the conventional car Mustang GT with a combustion engine.
TestTrack is a class that takes the two cars for a test. Running the provided program will yield the following output.
Ford Mustang GT is going at
Ford Mustang GT is going at
Ford Mustang GT is going at
Ford Mustang GT is going at
Tesla Model is going at
Tesla Model is going at
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
