An abstract class Player has two subclasses, Bowler and Batsman. The abstract class has one abstract method, average, and also has a constructor and…

An abstract class Player has two subclasses, Bowler and Batsman. The abstract class has one abstract method, average, and also has a constructor and a string function that displays the name Bowler or Batsman. The Batsman class implements the abstract function average and displays the result; the Batsman class has runs and number-of-matches data. Now write a Java program and show the Batsman's average run.

From the Janata Bank Assistant System Administrator 2021 – Written exam, question 8 of 12.

More from this paper